 
         private func incrementCurrentFrameIndex() {
             currentFrameIndex = increment(frameIndex: currentFrameIndex)
-            if isReachMaxRepeatCount && isLastFrame {
-                isFinished = true
-            } else if currentFrameIndex == 0 {
+            if isLastFrame {
                 currentRepeatCount += 1
+                if isReachMaxRepeatCount {
+                    isFinished = true
+                }
                 delegate?.animator(self, didPlayAnimationLoops: currentRepeatCount)
             }
         }

    }
}
#endif

#endif

//
//  The name and characters used in the demo of this software are property of their
//  respective owners.

#if canImport(UIKit)
import UIKit
