suguru / Cheetah

Easy animation library on iOS with Swift2
MIT License
590 stars 47 forks source link

Cannot start new animation on completion #14

Open PJDavis1970 opened 6 years ago

PJDavis1970 commented 6 years ago

I want to be able to do a 3 - 2 - 1 countdown animation on a view which has a label inside. However it does not work. I have been trying to figure out why but believe its to do with something not being reset after first animation sequence. Here is my code.

    countinView.cheetah
        .scale(2).duration(0.3)
        .wait(0.4)
        .scale(0).duration(0.3)
        .rotate(Double.pi*2).duration(0.3)
        .alpha(0).duration(0.3)
        .run()
        .completion {
            self.countInValue = self.countInValue - 1
            if self.countInValue > 0 {
                self.showCountInLabel()
            } else {
                self.timerBarStartTimer()
            }
    }