Type Method


Creates and returns an animated image.


class func animatedImageNamed(_ name: String, duration: TimeInterval) -> UIImage?



The full or partial path to the file (sans suffix).


The duration of the animation.

Return Value

A new image object.


This method loads a series of files by appending a series of numbers to the base file name provided in the name parameter. For example, if the name parameter had ‘image’ as its contents, this method would attempt to load images from files with the names ‘image0’, ‘image1’ and so on all the way up to ‘image1024’. All images included in the animated image should share the same size and scale.

See Also

Creating Animated Images

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software