Inherits From
NSObjectPHLivePhoto
Conforms To
NSCopyingNSObjectNSSecureCodingImport Statement
OBJECTIVE-C
@import Photos;
Availability
Available in iOS 9.1 and later
A Live Photo is a picture, captured by the Camera app on a supported device, that includes motion and sound from the moments just before and after it was taken. A PHLivePhoto object represents the combined photo, motion, and sound data that produces such a picture. 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.
NOTE
For guidance on how to integrate Live Photos with your app’s user experience, see
Live Photos in
iOS Human Interface Guidelines.
The PHLivePhoto class serves in much the same role for Live Photos as the
UIImage class serves for static images. A UIImage 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.)
Inspecting a Live Photosize Property
Loading a Live Photo from Data Files+ requestLivePhotoWithResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:+ cancelLivePhotoRequestWithRequestID:Data Types
PHLivePhotoRequestIDConstantsImage Request IdentifiersResult Handler Info Dictionary Keys2:PHLivePhotoRequestOptions
Inherits From
NSObjectPHLivePhotoRequestOptions
Conforms To
NSCopyingNSObjectImport Statement
OBJECTIVE-C
@import Photos;
Availability
Available in iOS 9.1 and later
You use a PHLivePhotoRequestOptions object to specify options when requesting Live Photo representations of photo assets from a
PHImageManager object. A Live Photo is a picture that includes movement and sound from the moments just before and after its capture.
Specifying Image Request OptionsdeliveryMode Property
Fetching Image Data from iCloudnetworkAccessAllowed Property
progressHandler Property
3:PHLivePhotoView
Inherits From
NSObjectUIResponderUIViewPHLivePhotoView
Conforms To
NSCodingNSObjectUIAppearanceUIAppearanceContainerUICoordinateSpaceUIDynamicItemUIFocusEnvironmentUITraitEnvironmentImport Statement
OBJECTIVE-C
@import PhotosUI;
Availability
Available in iOS 9.1 and later
A PHLivePhotoView object is a view that displays a Live Photo—a picture that also includes motion and sound from the moments just before and after its capture. After obtaining a
PHLivePhoto object (either from the Photos library using the
UIImagePickerController or
PHAsset and
PHImageManager classes, or by creating one from asset resources exported from a Photos library), use a Live Photo view to display the photo and control playback of its motion and sound content.
NOTE
For guidance on how to integrate Live Photos with your app’s user experience, see
Live Photos in
iOS Human Interface Guidelines.
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
playbackGestureRecognizer property.
Typically, an app does not need to directly control Live Photo playback. In some situations, however, it can be useful to briefly animate the view to indicate to the user that a picture is a Live Photo. To do this, use the
startPlaybackWithStyle: method with the
PHLivePhotoViewPlaybackStyleHint option.
Choosing a Live Photo to DisplaylivePhoto Property
Managing PlaybackplaybackGestureRecognizer Property
muted Property
Responding to Playback Eventsdelegate Property
Manually Playing Live Photo Content- startPlaybackWithStyle:- stopPlaybackAccessing User Interface Icons for Live Photos+ livePhotoBadgeImageWithOptions:ConstantsPHLivePhotoViewPlaybackStylePHLivePhotoBadgeOptions4:PHLivePhotoViewDelegate
Inherits From
NSObjectConforms To
Not Applicable
Import Statement
OBJECTIVE-C
@import PhotosUI;
Availability
Available in iOS 9.1 and later
The PHLivePhotoViewDelegate protocol describes messages sent by a
PHLivePhotoView instance in response to playback events when playing the motion and sound content associated with a Live Photo. To receive these messages, implement the methods in this protocol in one of your controller objects and assign that object to the
delegate property of a Live Photo view.
Responding to Live Photo Playback Events- livePhotoView:willBeginPlaybackWithStyle:- livePhotoView:didEndPlaybackWithStyle: