Convert constant to Int during declaration
This commit is contained in:
parent
b75ae099d1
commit
fbdb1c9a82
10
Gifu.swift
10
Gifu.swift
|
@ -68,11 +68,11 @@ class AnimatedImage: UIImage {
|
||||||
private func prepareFrames(source: CGImageSource!) {
|
private func prepareFrames(source: CGImageSource!) {
|
||||||
imageSource = source
|
imageSource = source
|
||||||
|
|
||||||
let numberOfFrames = CGImageSourceGetCount(self.imageSource)
|
let numberOfFrames = Int(CGImageSourceGetCount(self.imageSource))
|
||||||
frameDurations.reserveCapacity(Int(numberOfFrames))
|
frameDurations.reserveCapacity(numberOfFrames)
|
||||||
frames.reserveCapacity(Int(numberOfFrames))
|
frames.reserveCapacity(numberOfFrames)
|
||||||
|
|
||||||
for index in 0..<Int(numberOfFrames) {
|
for index in 0..<numberOfFrames {
|
||||||
let frameDuration = CGImageSourceGIFFrameDuration(source, index)
|
let frameDuration = CGImageSourceGIFFrameDuration(source, index)
|
||||||
frameDurations.append(frameDuration)
|
frameDurations.append(frameDuration)
|
||||||
totalDuration += frameDuration
|
totalDuration += frameDuration
|
||||||
|
@ -146,4 +146,4 @@ class AnimatedImage: UIImage {
|
||||||
func isAnimating() -> Bool {
|
func isAnimating() -> Bool {
|
||||||
return !displayLink.paused
|
return !displayLink.paused
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue