SwiftGif
v1.7.0: Many fixes
Esta biblioteca não é mais mantida. Eu recomendo usar o gifu.
Uma pequena extensão UIImage com suporte de 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 com o seguinte comando:
gem install cocoapods Integre o SwiftGIF ao seu projeto Xcode, criando um Podfile :
platform :ios , '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'SwiftGifOrigin' , '~> 1.7.0'
end Execute pod install para construir suas dependências.
Instale Cartago com Homebrew usando o seguinte comando:
brew update
brew install carthage Adicione a seguinte linha ao seu Cartfile para adicionar SwiftGIF:
github "bahlo/SwiftGif" ~> 1.7.0
Execute carthage update para criar a estrutura e arrastar o SwiftGif.framework construído para o seu projeto Xcode.
Fácil, faz o seguinte:
$ 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 projeto é fortemente inspirado no UIImage-From-Animated-GIF. Parabéns a @mayoff. ?
Este repositório é licenciado sob a licença do MIT, mais sob licença.