Increase verbosity
This commit is contained in:
parent
534a9b5f29
commit
41f6185043
|
@ -72,12 +72,16 @@ public class AnimatedImage: UIImage {
|
||||||
let numberOfFrames = Int(CGImageSourceGetCount(imageSource))
|
let numberOfFrames = Int(CGImageSourceGetCount(imageSource))
|
||||||
animatedFrames.reserveCapacity(numberOfFrames)
|
animatedFrames.reserveCapacity(numberOfFrames)
|
||||||
|
|
||||||
(animatedFrames, totalDuration) = reduce(0..<numberOfFrames, ([AnimatedFrame](), 0.0)) { accum, index in
|
(animatedFrames, totalDuration) = reduce(0..<numberOfFrames, ([AnimatedFrame](), 0.0)) { accumulator, index in
|
||||||
|
let accumulatedFrames = accumulator.0
|
||||||
|
let accumulatedDuration = accumulator.1
|
||||||
|
|
||||||
let frameDuration = CGImageSourceGIFFrameDuration(imageSource, index)
|
let frameDuration = CGImageSourceGIFFrameDuration(imageSource, index)
|
||||||
let frameImageRef = CGImageSourceCreateImageAtIndex(imageSource, UInt(index), nil)
|
let frameImageRef = CGImageSourceCreateImageAtIndex(imageSource, UInt(index), nil)
|
||||||
let frame = UIImage(CGImage: frameImageRef)?.resize(size)
|
let frame = UIImage(CGImage: frameImageRef)?.resize(size)
|
||||||
let animatedFrame = AnimatedFrame(image: frame, duration: frameDuration)
|
let animatedFrame = AnimatedFrame(image: frame, duration: frameDuration)
|
||||||
return (accum.0 + [animatedFrame], accum.1 + frameDuration)
|
|
||||||
|
return (accumulatedFrames + [animatedFrame], accumulatedDuration + frameDuration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue