SwiftGif
v1.7.0: Many fixes
Esta biblioteca ya no se mantiene. Recomiendo usar gifu en su lugar.
Una pequeña extensión UIImage con soporte GIF.

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 " ) Instale Cocoapods con el siguiente comando:
gem install cocoapods Integre swiftgif en su proyecto Xcode creando un Podfile :
platform :ios , '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'SwiftGifOrigin' , '~> 1.7.0'
end Ejecute pod install para construir sus dependencias.
Instale Carthage con HomeBrew usando el siguiente comando:
brew update
brew install carthage Agregue la siguiente línea a su Cartfile para agregar SwiftGif:
github "bahlo/SwiftGif" ~> 1.7.0
Ejecute carthage update para crear el marco y arrastre el SwiftGif.framework construido en su proyecto Xcode.
Fácil, hace lo siguiente:
$ xcodebuild
-project SwiftGif.xcodeproj
-scheme SwiftGif
-sdk iphonesimulator
-destination "platform=iOS Simulator,name=iPhone 8"
build test
CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""
Este proyecto está fuertemente inspirado en Uiimage-from-animado-gif. Felicitaciones a @mayoff. ?
Este repositorio tiene licencia bajo la licencia MIT, más bajo licencia.