animation - Swift synchronize CABasicAnimation with label.text -


i have circular progress bar, animated via:

func animatecircle(from: double, to: double ) {     let animation = cabasicanimation(keypath: "strokeend")     animation.duration = 2     animation.fromvalue =     animation.tovalue = to/60     animation.timingfunction = camediatimingfunction(name: kcamediatimingfunctionlinear)     self.progresscircle.strokeend = cgfloat(to/60)     self.progresscircle.addanimation(animation, forkey: "animatecircle") } 

the stroke-animation works , visualizes "minutes 0-60". in center of animated circle label, should animated (counting, duration 2 seconds) too. there way add "change-event" cabasicanimation or cashapelayer synchronize label shape itself. ideas?

you don't need synchronize them. if start 2-second animation of label @ same time start circle animation, happen together. in demonstration, run repeating timer make label count:

enter image description here


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -