Is there any way to animate uiview moving with cicle trajectory?
2 Answers
You will have to create a circular path and animate your view on the path. You can use UIBezierPath to create a circular path . Here is an example that does what exactly you want.
-
Can't understand how to use bezierpath for moving imageview – B.S. Apr 09 '12 at 13:24
There are a couple of options. Probably the simplest is to place your view on a parent view, and then animate rotating the parent view around its Z axis.
I guess you could also build a transform that shifts your view, then rotates it, and animate the transform to different rotation values. I'd have to tinker with that. I know the first approach would be quick and easy to set up.
As the other poster said, you could also create a keyframe animation that uses a CGPath to animate your view along a curve that approximated the shape of a circle, but that would be much more work.

- 128,072
- 22
- 173
- 272
-
This is a very interesting answer! I can't believe I didn't think of before! It's by far the simplest answer if all you have to do is to rotate in a circular path! – M. Porooshani Dec 21 '15 at 10:28