Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #4 from JoelSimonoff/master
Browse files Browse the repository at this point in the history
Fixed UIImage+Gif.swift and RootViewController.swift
  • Loading branch information
bahlo committed Apr 22, 2015
2 parents 9a30a5a + fe489a6 commit 106d87b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions SwiftGifCommon/UIImage+Gif.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ extension UIImage {
return image
}

class func delayForImageAtIndex(index: UInt, source: CGImageSourceRef)
class func delayForImageAtIndex(index: Int, source: CGImageSource!)
-> Double {
var delay = 0.1

// Get dictionaries
let cfProperties = CGImageSourceCopyPropertiesAtIndex(source, index,
nil)
let cfProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil)
let gifProperties: CFDictionaryRef = unsafeBitCast(
CFDictionaryGetValue(cfProperties,
unsafeAddressOf(kCGImagePropertyGIFDictionary)),
Expand Down Expand Up @@ -108,7 +107,7 @@ extension UIImage {
images.append(CGImageSourceCreateImageAtIndex(source, i, nil))

// At it's delay in cs
var delaySeconds = UIImage.delayForImageAtIndex(UInt(i),
var delaySeconds = UIImage.delayForImageAtIndex(Int(i),
source: source)
delays.append(Int(delaySeconds * 1000.0)) // Seconds to ms
}
Expand Down
2 changes: 1 addition & 1 deletion SwiftGifDemo/RootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

class RootViewController: UIViewController {

override init() {
init() {
super.init(nibName: nil, bundle: nil);
}

Expand Down

0 comments on commit 106d87b

Please sign in to comment.