Search code examples
iosobjective-cuikituiviewanimation

Moving an object (UIButton) through a circular path by keeping the parent view static


How do I move some buttons into a circular path (using the center of an circular UIView) by 45 degree each time any of the buttons is clicked? You can say it's just like JOG WHEEL.


Solution

    1. Create a CGPathRef that contains the path along which you want to animate the view.
    2. Create a CAKeyframeAnimation.
    3. Assign the path to the animation.path property.
    4. Add the animation to the view's layer.