https://github.com/krisyu/gifext
UIImage and UIImageView extensions to support gif animate on iOS.
https://github.com/krisyu/gifext
gif swift3 uiimage uiimageview
Last synced: 2 months ago
JSON representation
UIImage and UIImageView extensions to support gif animate on iOS.
- Host: GitHub
- URL: https://github.com/krisyu/gifext
- Owner: KrisYu
- Created: 2017-04-02T01:23:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-03T00:06:16.000Z (about 8 years ago)
- Last Synced: 2025-01-12T00:28:15.812Z (4 months ago)
- Topics: gif, swift3, uiimage, uiimageview
- Language: Swift
- Homepage:
- Size: 4.98 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# GifExt
**Proudly animate Gif on iOS with less than 100 lines of code.**

Basically this is a copycat of [SwiftGif](https://github.com/bahlo/SwiftGif). Differences:
1. Play gif as it is.
2. UIImageView load gif from URL.## Usage
Since this is just an Extension, you can just
1. download the [GifExt.swift](https://github.com/KrisYu/GifExt/blob/master/GifExt.swift) file
2. add it to your project.
3. use it like as below```
// create animated UIImage
let localGifURL = Bundle.main.url(forResource: "laugh", withExtension: "gif")
let gifFile = UIImage.gif(url:localGifURL!)
localImageView.image = gifFile// load gif from web
let webGifURL = URL(string: "https://media.giphy.com/media/3og0IuvANdUUmpVeA8/giphy.gif")
webImageView.loadGif(url: webGifURL!)
```