Latest 0.3.0
Homepage https://github.com/eduardourso/GIFGenerator
License MIT
Platforms ios 8.0, requires ARC
Frameworks ImageIO, MobileCoreServices
Authors

.GIFGenerator

Build Status
Version
License
Platform

Add to your project

There are 2 ways you can add .GIFGenerator to your project:

Manual installation

Simply import the ‘GIFGenerator’ folder into your project then import the classes that you want to use.

Obj-C

#import "GIFGenerator.h"

Swift

import GIFGenerator

Avaliable in CocoaPods

GIFGenerator is available through CocoaPods See the "Getting Started" guide for more information.

To install it, simply add the following line to your Podfile:

Podfile

platform :ios, '8.0'
pod "GIFGenerator"

Practical use

let gifGenerator = GifGenerator()

gifGenerator.generateGifFromImages(imagesArray, frameDelay: 0.5, destinationURL: url, callback: { (data, error) -> () in
  //returns a gif file.
})

//ATENTION: you must provide the part of the video that you want to convert, so if you need to convert just from the 0:10 to 0:20 sec. you must cut and deal with the video before you send it to the library.
gifGenerator.generateGifFromVideoURL(videoURL: url, framesInterval: 10, frameDelay: 0.2, destinationURL: NSURL(fileURLWithPath: destinationPath), callback: { (data, error) -> () in
  //returns a gif file.
})

This generates a GIF from provided images or video file.

The library is lightweight and very straight forward. Once you have the array of images, pass it to GIFGenerator alongside the url and frame delay.
Let me explain those for you:

imagesArray - array of images that will compose the GIF file!
frameDelay  -  is the amount of time between each frame in the GIF.
destinationURL  - is the url where the GIF file will be stored.

Or if you have the video url, pass it to GIFGenerator alongside the url and frame delay.
Let me explain those for you:

videoURL - url where the video is stored that will compose the GIF file!
frameDelay  -  is the amount of time between each frame in the GIF.
destinationURL  - is the url where the GIF file will be stored.

I recommend you to play with those parameters to see how it can affect the GIF file.

Example Project

To run the example project, clone the repo, and run pod install from the Example directory first.

Author

Eduardo Urso, [email protected]

If you have any doubts, comments or improvements just shoot me an email.

License

GIFGenerator is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "GIFGenerator",
    "version": "0.3.0",
    "summary": "Generate animated GIF in iOS",
    "description": "Generates a GIF (from images and videos) file and saves it to an specific URLn- Set frame delaysn- Set loop count",
    "homepage": "https://github.com/eduardourso/GIFGenerator",
    "license": "MIT",
    "authors": {
        "Eduardo Urso": "[email protected]"
    },
    "source": {
        "git": "https://github.com/eduardourso/GIFGenerator.git",
        "tag": "0.3.0"
    },
    "social_media_url": "https://twitter.com/DuUrso",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "frameworks": [
        "ImageIO",
        "MobileCoreServices"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This