I have a UIImageView with an array of images it iterates through to form an animation.
[imageView setAnimationImages:arrayOfImages];
I now need to move this image view along a path whilst it is animating. I had a look through the source code of this example. It uses UIBezierPath to create the path and CALayer to represent the object that moves along the path. But how would I do this for a animating UIImageView?
Many thanks for any advice.
[EDIT] Please note I also had to add the UIImageView as a subview to the current view.
Finally figured it out using the example I gave before. Here are my steps:
Create the path. (note P = CGPointMake in the code below)
….
Create the UIImageView and give it an array of animation images.
Set the UIImageView’s layer position and add the layer to the view’s layer:
Create the CAKeyframeAnimation: