Thursday 15 April 2010

ios - Rotation animation of multiple UIButtons, how can animationDidStop know which stopped? -



ios - Rotation animation of multiple UIButtons, how can animationDidStop know which stopped? -

i'm trying create 4 uibuttons rotate in swift. got this:

import uikit extension uiview { func rotate360degrees(duration: cftimeinterval = 1.0, completiondelegate: anyobject? = nil) { allow rotateanimation = cabasicanimation(keypath: "transform.rotation") rotateanimation.fromvalue = 0.0 rotateanimation.tovalue = cgfloat(m_pi * 2.0) rotateanimation.duration = duration if allow delegate: anyobject = completiondelegate { rotateanimation.delegate = delegate } self.layer.addanimation(rotateanimation, forkey: nil) } }

but need repeat. in uiviewcontroller used animationdidstop function how can know of 4 animation triggers it? has parameter called caanimation cannot compare anything. suggestion?

re-write method using catransition , utilize solution question: how identify caanimation within animationdidstop delegate?

ios animation swift uiview uibutton

No comments:

Post a Comment