MengTo / Spring

A library to simplify iOS animations in Swift.
http://designcode.io
MIT License
14.09k stars 1.81k forks source link

i want to make my image view disappear after the animation is finished #238

Open chitvan832 opened 7 years ago

chitvan832 commented 7 years ago

my attempt for this is :

@IBAction func btnActionForHeart(_ sender: UIButton) {
    centerHeart.animation = "pop"
    centerHeart.duration = 1.0
    centerHeart.curve = "easeIn"
    centerHeart.animateNext{
       self.centerHeart.alpha = 0
        self.centerHeart.animate()
    }

PS : trying to make an instagram like heart animation when we double tap

tunds commented 7 years ago

Alpha isn't a property of spring and you could use centerHeart.animation = "fadeOut" and then animate it rather than setting the alpha