Skip to content

Commit

Permalink
Fix intrinsic size bug
Browse files Browse the repository at this point in the history
- Animated image class always returned `CGRectZero` as intrinsic content size
- Fixes #7
  • Loading branch information
Reda Lemeden committed Dec 21, 2014
1 parent b87464f commit c51f0f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/AnimatedImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ public class AnimatedImage: UIImage {
var animatedFrames = [AnimatedFrame]()
var totalDuration: NSTimeInterval = 0.0

override public var size: CGSize {
return frameAtIndex(0)?.size ?? CGSizeZero
}

// MARK: - Private Properties
private lazy var displayLink: CADisplayLink = CADisplayLink(target: self, selector: "updateCurrentFrame")
private var currentFrameIndex = 0
Expand Down

0 comments on commit c51f0f7

Please sign in to comment.