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!) {
|
||||
imageSource = source
|
||||
|
||||
let numberOfFrames = CGImageSourceGetCount(self.imageSource)
|
||||
frameDurations.reserveCapacity(Int(numberOfFrames))
|
||||
frames.reserveCapacity(Int(numberOfFrames))
|
||||
let numberOfFrames = Int(CGImageSourceGetCount(self.imageSource))
|
||||
frameDurations.reserveCapacity(numberOfFrames)
|
||||
frames.reserveCapacity(numberOfFrames)
|
||||
|
||||
for index in 0..<Int(numberOfFrames) {
|
||||
for index in 0..<numberOfFrames {
|
||||
let frameDuration = CGImageSourceGIFFrameDuration(source, index)
|
||||
frameDurations.append(frameDuration)
|
||||
totalDuration += frameDuration
|
||||
|
@ -146,4 +146,4 @@ class AnimatedImage: UIImage {
|
|||
func isAnimating() -> Bool {
|
||||
return !displayLink.paused
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue