PHLivePhoto
A displayable representation of a Live Photo—a picture that includes motion and sound from the moments just before and after its capture.
Declaration
class PHLivePhotoMentioned in
Overview
In iOS and tvOS, you can use this class to reference Live Photos from the user’s library (fetched with the PHAsset and PHImageManager classes), to load displayable Live Photo objects from data obtained elsewhere (such as pictures shared through a social network), and to assign Live Photos to PHLivePhotoView objects for display.
In iOS, tvOS, and macOS, you can use this class to display edits in progress for Live Photo content in a photo editing extension.
The PHLivePhoto class serves in much the same role for Live Photos as the UIImage or NSImage class serves for static images. A UIImage or NSImage object represents not the data file an image is loaded from, but instead a ready-to-use image that can be displayed in a view—similarly, a PHLivePhoto object represents a Live Photo ready to display with motion and sound using a PHLivePhotoView object, not an entry in the Photos library or the data resources that constitute a Live Photo. (To work with Live Photos as elements of the Photos library, use the PHAsset class. To work with the data files that constitute a Live Photo, use the PHAssetResource class.)
Topics
Inspecting a Live Photo
Loading a Live Photo from Data Files
request(withResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:)cancelRequest(withRequestID:)