I have a setter method for a property on a custom UIView class. If it’s set within a UIView animation block, I’d like it to add a CABasicAnimation to the view’s layer with the same duration and easing as the UIView animation. How do I find out whether I’m inside a UIView animation block, and how do I get its duration and easing curve?
I have a setter method for a property on a custom UIView class. If
Share
Based on this question I made this extension to
UIViewblock animations: UIView+AnimatedProperty.It allows you to run
CAAnimationswhen the setter is called from animation block. Example withcornerRadiusis included.