Thursday, May 28, 2026
HomeiOS Developmentios - Lottie Animation: play animation even after AnimatedButton is clicked

ios – Lottie Animation: play animation even after AnimatedButton is clicked

[ad_1]

I’m utilizing an AnimatedButton from Lottie framework and it really works wonderful however the one downside I’ve is that animation stops taking part in as soon as the AnimatedButton is clicked, once I need the button to animate on a regular basis, even after the press.

let middleButton = AnimatedButton()
    
 middleButton.body.measurement = CGSize(width: 80, peak: 80)
    
 middleButton.animation = Animation.named("eye")       
 middleButton.animationView.play()
 middleButton.animationView.loopMode = .autoReverse
 middleButton.animationView.backgroundBehavior = .pauseAndRestore
 middleButton.addTarget(self, motion: #selector(self.middleButtonAction), for: .touchUpInside)

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments