All Projects → swiftgif → Swiftgif

swiftgif / Swiftgif

Licence: mit
[UNMAINTAINED] 🌠 A small UIImage extension with gif support

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swiftgif

R.objc
Get autocompleted resources like images, localized strings and storyboards in ObjC projects
Stars: ✭ 92 (-92.67%)
Mutual labels:  xcode, uiimage
Read Only Coding
Automator services to make coding in Xcode easier
Stars: ✭ 82 (-93.47%)
Mutual labels:  xcode
Emacs Gif Screencast
[MOVED TO GITLAB] One-frame-per-action GIF recording for optimal quality/size ratio
Stars: ✭ 74 (-94.1%)
Mutual labels:  gif
Update xcode plugins
No more messing with plugin UUIDs; Plugins on Xcode 8+!
Stars: ✭ 1,212 (-3.43%)
Mutual labels:  xcode
Xgist
Xcode extension to send code to GitHub's Gist
Stars: ✭ 75 (-94.02%)
Mutual labels:  xcode
Spellchecker
SpellChecker for Xcode
Stars: ✭ 79 (-93.71%)
Mutual labels:  xcode
Macimagesetgenerator
2个脚本文件,帮助你在Mac上,生成Xcode可使用的APP图标和启动图。
Stars: ✭ 73 (-94.18%)
Mutual labels:  xcode
Sfacecompare
Simple lib for iOS to find and compare faces.
Stars: ✭ 83 (-93.39%)
Mutual labels:  xcode
Xcodecolorsense
🎈 An Xcode plugin that makes working with color easier
Stars: ✭ 79 (-93.71%)
Mutual labels:  xcode
Hackernewsclient Ios
An iOS client for Hacker News
Stars: ✭ 77 (-93.86%)
Mutual labels:  xcode
Ios Toolbox
My iOS dev toolbox.
Stars: ✭ 76 (-93.94%)
Mutual labels:  xcode
Toolgif
💭 The only GIF tooltip plugin you need
Stars: ✭ 75 (-94.02%)
Mutual labels:  gif
Phimpme Ios
Phimp.me - Photo Image Editor and Sharing App. Phimp.me is a Photo App for iOS that aims to replace proprietary photo applications. It offers features such as taking photos, adding filters, editing images and uploading them to social networks.
Stars: ✭ 79 (-93.71%)
Mutual labels:  xcode
Macdown
Open source Markdown editor for macOS.
Stars: ✭ 8,855 (+605.58%)
Mutual labels:  xcode
Statefultabview
A SwiftUI TabView that retains the state of each tab as well as some other goodies.
Stars: ✭ 83 (-93.39%)
Mutual labels:  xcode
Lldb
A collection of LLDB aliases/regexes and Python scripts to aid in your debugging sessions
Stars: ✭ 1,187 (-5.42%)
Mutual labels:  xcode
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-93.94%)
Mutual labels:  xcode
Xcactionbar
"Alfred for Xcode" plugin
Stars: ✭ 1,217 (-3.03%)
Mutual labels:  xcode
Notgif
Play & Share your GIFs in Photos
Stars: ✭ 84 (-93.31%)
Mutual labels:  gif
Android Gif Drawable
Views and Drawable for displaying animated GIFs on Android
Stars: ✭ 8,987 (+616.1%)
Mutual labels:  gif

⚠️ UNMAINTAINED ⚠️

This library is no longer maintained. I recommend using Gifu instead.


SwiftGif Swift 3.0 Carthage compatible CocoaPods License MIT Build Status

A small UIImage extension with gif support.

Demo gif

Usage

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")

Installation

CocoaPods

Install CocoaPods with the following command:

gem install cocoapods

Integrate SwiftGif into your Xcode project by creating a Podfile:

platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'SwiftGifOrigin', '~> 1.7.0'
end

Run pod install to build your dependencies.

Carthage

Install Carthage with Homebrew using the following command:

brew update
brew install carthage

Add the following line to your Cartfile to add SwiftGif:

github "bahlo/SwiftGif" ~> 1.7.0

Run 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:

  1. Find out the duration of every frame
  2. Find the greatest common divisor
  3. Add frames accordingly to the greatest common divisor to an array
  4. Create an animated UIImage with the frames

Testing

$ xcodebuild \
  -project SwiftGif.xcodeproj \
  -scheme SwiftGif \
  -sdk iphonesimulator \
  -destination "platform=iOS Simulator,name=iPhone 8" \
  build test \
  CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""

Inspiration

This project is heavily inspired by uiimage-from-animated-gif. Kudos to @mayoff. 👍

License

This repository is licensed under the MIT license, more under LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].