当我运行应用程序时,在此行self.init(data: imageData), 'self' used inside 'catch' block reachable from self.init call
和便捷行self.init(named: imageName) , 'self.init' called multiple times in initializer
上获得便利功能错误,
convenience init?(imageData:Data, levelOfIntegrity: GifLevelOfIntegrity = .default) throws {
do {
try self.init(gifData: imageData, levelOfIntegrity: levelOfIntegrity)
} catch {
self.init(data: imageData)
}
}
convenience init?(imageName: String, levelOfIntegrity: GifLevelOfIntegrity = .default) throws {
self.init()
do {
try setGif(imageName, levelOfIntegrity: levelOfIntegrity)
} catch {
self.init(named: imageName)
}
}
应用程序应该能够正常运行