Created
February 18, 2021 13:48
-
-
Save ahmdmau/23e92b3159a0ea4695d39ca13dc083fc to your computer and use it in GitHub Desktop.
Extension FLAnimatedImage for loading gif in asset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import FLAnimatedImage | |
extension FLAnimatedImage { | |
convenience init (gifResource: String) { | |
if let data = NSDataAsset(name: gifResource) { | |
self.init(animatedGIFData: data.data) | |
} else { | |
self.init(animatedGIFData: nil) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment