From 310377cb914ece70b24d4c267f9b19be27100d55 Mon Sep 17 00:00:00 2001 From: Nawar Nory Date: Sun, 24 Jan 2016 15:01:02 -0400 Subject: [PATCH] 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 --- Source/AnimatableImageView.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/AnimatableImageView.swift b/Source/AnimatableImageView.swift index b7f1e22..58cf250 100644 --- a/Source/AnimatableImageView.swift +++ b/Source/AnimatableImageView.swift @@ -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() {