If you are targeting iOS7 and already have an image broken into frames, you can use animatedImageNamed:duration:
Say you revive a spinner. Copy all your frames into the project and name them as follows:
spinner-1.pngspinner-2.pngspinner-3.png- etc.,
Then create an image using:
[UIImage animatedImageNamed:@"spinner-" duration:1.0f];
From the docs :
This method loads a series of files by adding a series of numbers to the base file name specified in the name parameter. For example, if the name parameter had "image as its contents", this method try to load images from files named image0, image1, and so on up to 'image1024. All images included in the animated image must have the same size and scale.
Joe Masilotti Feb 20 '14 at 15:08 2014-02-20 15:08
source share