Convert constant to Int during declaration

This commit is contained in:
Reda Lemeden 2014-09-07 23:27:58 +02:00
parent b75ae099d1
commit fbdb1c9a82
1 changed files with 5 additions and 5 deletions

View File

@ -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
} }
} }