Add a reset function

- If Gifu is used within a UITableViewCell, there's no way to reset the animator directly. Otherwise, the UITableViewCell reuse of images get overlapped.
- Closes #33
This commit is contained in:
Nawar Nory 2016-01-24 15:01:02 -04:00 committed by Reda Lemeden
parent 19305b8290
commit 310377cb91
1 changed files with 6 additions and 0 deletions

View File

@ -66,6 +66,12 @@ public class AnimatableImageView: UIImageView {
public func stopAnimatingGIF() {
displayLink.paused = true
}
/// Reset the image view values
public func prepareForReuse() {
stopAnimatingGIF()
animator = nil
}
/// Update the current frame with the displayLink duration
func updateFrame() {