A displayable representation of a Live Photo—a picture that includes motion and sound from the moments just before and after its capture.
Language
- Swift
- Objective-C
SDKs
- iOS 9.1+
- macOS 10.12+
- tvOS 10.0+
Overview
In iOS and tvOS, you can use this class to reference Live Photos from the user’s library (fetched with the PHAsset and PHImage 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 PHLive 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.
Note
For guidance on how to integrate Live Photos with your app’s user experience, see Live Photos in iOS Human Interface Guidelines.
The PHLive 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 PHLive object represents a Live Photo ready to display with motion and sound using a PHLive 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 PHAsset class.)
Tip
To display Live Photo content on the web, use the LivePhotosKit JS framework.