How do I rotate animate a UIView but with respect of a point?
It's kinda like how the moon is rotating the earth kinda movement. It rotates around the earth as opposed to just the开发者_如何转开发 moon itself rotating.Thanks,
TeeI think what you'll need to do here is use a CAKeyframeAnimation to move your view along a path. In this case, of course, you'll use a circular path. However, you also want to rotate the view. A CABasicAnimation should work for that. You can run both animations simultaneously using CAAnimationGroup.
Warning: I haven't tried this, so if you encounter trouble that makes you think this is the wrong path, trust that.
It seems like you might also be able to do the whole animation using a single keyframe animation on the view's transform
property. That may or may not be the case, but calculating an array of intermediate transformation matrices doesn't seem like a lot of fun.
Let us know how it works out.
精彩评论