Heartbeat Animation (Infinite) Button

PHOTO EMBED

Sat Apr 06 2024 10:43:34 GMT+0000 (Coordinated Universal Time)

Saved by @Saurabh_Lodhi #animation

        let animation = CAKeyframeAnimation(keyPath: "transform.scale")
        animation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
        animation.duration = 1
        animation.values = [1.0, 1.5, 1.0, 1.5, 1]
        animation.keyTimes = [0, 0.2, 0.4, 0.7, 1]
        animation.repeatCount = .infinity
        Your_Button_Name.layer.add(animation, forKey: "heartbeat")
content_copyCOPY