SwiftGif
v1.7.0: Many fixes
ห้องสมุดนี้ไม่ได้รับการดูแลอีกต่อไป ฉันแนะนำให้ใช้ gifu แทน
ส่วนขยาย UIImage ขนาดเล็กพร้อมการสนับสนุน 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 " ) ติดตั้ง cocoapods ด้วยคำสั่งต่อไปนี้:
gem install cocoapods รวม SwiftGif เข้ากับโครงการ XCode ของคุณโดยการสร้าง Podfile :
platform :ios , '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'SwiftGifOrigin' , '~> 1.7.0'
end Run pod install เพื่อสร้างการพึ่งพาของคุณ
ติดตั้ง Carthage ด้วย Homebrew โดยใช้คำสั่งต่อไปนี้:
brew update
brew install carthage เพิ่มบรรทัดต่อไปนี้ไปยัง Cartfile ของคุณเพื่อเพิ่ม SwiftGif:
github "bahlo/SwiftGif" ~> 1.7.0
เรียกใช้ carthage update เพื่อสร้างเฟรมเวิร์กและลาก SwiftGif.framework ที่สร้างขึ้นในโครงการ XCODE ของคุณ
ง่ายต่อไปนี้:
$ xcodebuild
-project SwiftGif.xcodeproj
-scheme SwiftGif
-sdk iphonesimulator
-destination "platform=iOS Simulator,name=iPhone 8"
build test
CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""
โครงการนี้ได้รับแรงบันดาลใจอย่างมากจาก UIImage-from-animated-GIF รุ่งโรจน์ถึง @Mayoff -
ที่เก็บนี้ได้รับใบอนุญาตภายใต้ใบอนุญาต MIT ภายใต้ใบอนุญาตเพิ่มเติม