Asynchronously loads a Live Photo from the specified resource files.
- iOS 9.1+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 10+
An array of URLs containing the resource URLs that constitute a Live Photo, as obtained using the
A static image to represent the Live Photo before its full content has been loaded and validated.
The target size of Live Photo to be returned. Pass
CGSizeto obtain the requested Live Photo at its original size.
An option for how to fit the image to the aspect ratio of the requested size. For details, see
A block to be called when image loading is complete, providing the requested Live Photo or information about the status of the request.
The block takes the following parameters:
The requested Live Photo object.
A dictionary providing information about the status of the request. See
PHLivefor possible keys and values.
A numeric identifier for the request. If you need to cancel the request before it completes, pass this identifier to the
Use this method to load Live Photo objects for display from data files previously exported from a Photos library. For example, a social networking app can use the
PHAsset class to retrieve the data files that constitute a Live Photo in one user’s library and upload them to a server. Then, on another user’s device, the app downloads those data files and uses this method to re-create a Live Photo object for display using the
This method is asynchronous. Photos loads, validates, and prepares data on a background thread, then calls your
result block with a ready-to-display Live Photo object. Like the similar methods in the PHImageManager class, Photos can call your result handler block more than once—first, to provide a low-quality Live Photo object (consisting of only the static image from the
image parameter), then later to provide the full motion and sound content of the Live Photo. If the
PHLive value in your result handler’s
info dictionary is
YES, Photos will call your result handler again.
This method can load a
PHLive object only from the same set of files exported from a previously captured Live Photo asset. When you use this method, Photos validates that the files and their metadata can be loaded as a Live Photo. If Photos cannot load a Live Photo from the specified files, the
result parameter in your result handler block is
nil, and the
info dictionary contains an
NSError object describing the error.