Closed billypchan closed 5 years ago
Hi Alexis, Thanks for this great library! I have a suggestion for the case that the GIF has no kCGImagePropertyGIFDictionary, for example:
kCGImagePropertyGIFDictionary
When I load this image, I got an exception when calling try UIImage(gifName: gifName). Here is my workaround to make it loaded as a normal UIImage:
try UIImage(gifName: gifName)
UIImage
extension UIImageView { func setGif(gifName: String, gifManager: SwiftyGifManager) throws { do { let gifImage = try UIImage(gifName: gifName) setGifImage(gifImage, manager: gifManager, loopCount: -1) } catch let error { print("Error : \(error.localizedDescription)") if let gifImage = UIImage(named: "\(gifName).gif") { image = gifImage } else { throw MyGifParseError.retryUIImageInitFail } } } } enum MyGifParseError: Error { case retryUIImageInitFail }
I guess this is fixed with your last pull request as I see no_property_dictionary.gif is displayed correctly. Closing
no_property_dictionary.gif
Hi Alexis, Thanks for this great library! I have a suggestion for the case that the GIF has no
kCGImagePropertyGIFDictionary
, for example:When I load this image, I got an exception when calling
try UIImage(gifName: gifName)
. Here is my workaround to make it loaded as a normalUIImage
: