     /// - Note: This may decrease scrolling smoothness with lot's of animations
     open var allowAnimationInScrollView = false
     
+    open weak var delegate: APNGImageViewDelegate?
+    
     var timer: CADisplayLink?
     var lastTimestamp: TimeInterval = 0
     var currentPassedDuration: TimeInterval = 0


import UIKit

/// An APNG image view object provides a view-based container for displaying an APNG image.
/// You can control the starting and stopping of the animation, as well as the repeat count.
/// All images associated with an APNGImageView object should use the same scale. 

            currentFrameIndex = currentFrameIndex + 1
            
            if currentFrameIndex == image.frameCount {
                
                delegate?.apngImageView?(self, didFinishPlaybackForRepeatedCount: repeated)
                
                currentFrameIndex = 0
                repeated = repeated + 1
                
