SwiftGif alternatives and similar libraries
Based on the "GIF" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of SwiftGif or a related project?
UIImage extension with gif support.
import SwiftGifOrigin // An animated UIImage let jeremyGif = UIImage.gif(name: "jeremy") // A UIImageView with async loading let imageView = UIImageView() imageView.loadGif(name: "jeremy") // A UIImageView with async loading from asset catalog(from iOS9) let imageView = UIImageView() imageView.loadGif(asset: "jeremy")
Install CocoaPods with the following command:
gem install cocoapods
Integrate SwiftGif into your Xcode project by creating a
platform :ios, '9.0' use_frameworks! target '<Your Target Name>' do pod 'SwiftGifOrigin', '~> 1.7.0' end
pod install to build your dependencies.
brew update brew install carthage
Add the following line to your
Cartfile to add SwiftGif:
github "bahlo/SwiftGif" ~> 1.7.0
carthage update to build the framework and drag the built
SwiftGif.framework into your Xcode project.
How does it work?
Easy, it does the following:
- Find out the duration of every frame
- Find the greatest common divisor
- Add frames accordingly to the greatest common divisor to an array
- Create an animated UIImage with the frames
$ xcodebuild \ -project SwiftGif.xcodeproj \ -scheme SwiftGif \ -sdk iphonesimulator \ -destination "platform=iOS Simulator,name=iPhone 8" \ build test \ CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""
This repository is licensed under the MIT license, more under [LICENSE](LICENSE).
*Note that all licence references and agreements mentioned in the SwiftGif README section above are relevant to that project's source code only.