A view that displays a Live Photo—a picture that also includes motion and sound from the moments just before and after its capture.
SDKs
- iOS 9.1+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10+
Framework
- Photos
UI
Declaration
@interface PHLivePhotoView : UIView
@interface PHLivePhotoView : NSView
Overview
Use a Live Photo view to display the photo and control playback of its motion and sound content. In iOS and tvOS, you can obtain Live Photo objects from the Photos library, using the UIImage
or PHAsset
and PHImage
classes, or by creating one from asset resources exported from a Photos library. In macOS, Live Photo objects are available only when editing Live Photo content in a photo editing extension that runs in the Photos app—see the PHContent
class to access Live Photo content in an editing session.
By default, a Live Photo view uses its own gesture recognizer to allow the user to play the motion and sound content of a Live Photo with the same interactions and visual effects seen in the Photos app. To customize this gesture recognizer—for example, to install it on a different view for proper event handling in your app’s view hierarchy—use the playback
property.
To animate the view briefly to hint that a picture is a Live Photo, use the start
method with the PHLive
option.
Tip
This class displays Live Photos in native iOS and tvOS apps and macOS photo editing extensions. To display Live Photo content on the web, use the LivePhotosKit JS framework.