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:
parent
19305b8290
commit
310377cb91
|
@ -66,6 +66,12 @@ public class AnimatableImageView: UIImageView {
|
||||||
public func stopAnimatingGIF() {
|
public func stopAnimatingGIF() {
|
||||||
displayLink.paused = true
|
displayLink.paused = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Reset the image view values
|
||||||
|
public func prepareForReuse() {
|
||||||
|
stopAnimatingGIF()
|
||||||
|
animator = nil
|
||||||
|
}
|
||||||
|
|
||||||
/// Update the current frame with the displayLink duration
|
/// Update the current frame with the displayLink duration
|
||||||
func updateFrame() {
|
func updateFrame() {
|
||||||
|
|
Loading…
Reference in New Issue