Processes and saves a full-quality Live Photo as the output of your editing session.
SDKs
- iOS 10+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10+
Framework
- Photos
Declaration
- (void)saveLivePhotoToOutput:(PHContent Editing Output *)output options:(NSDictionary<NSString *,id> *)options completionHandler:(void (^)(BOOL success, NSError *error))handler;
Parameters
output
The photo editing output to receive the rendered Live Photo, created from the same
PHContent
object you used to begin this Live Photo editing context.Editing Input options
Options that affect Live Photo rendering. See Live Photo Processing Options.
handler
A block that Photos calls on the main queue after rendering is complete. The block takes the following parameters:
- success
YES
if rendering succeeds; otherwiseNO
.- error
If rendering succeeds, this parameter is
nil
. If rendering fails, this parameter contains an error object describing the failure.
Discussion
Use this method when you have finished an editing session and need to provide rendered output in a PHContent
object. Unlike when rendering output for a photo or video asset, you don’t need to provide rendered output using the rendered
property of the editing output object. Instead, create a PHContent
object using the init
initializer, passing the same PHContent
object you used in the PHLive
initializer to start this Live Photo editing context. Then pass that editing output object to this method, and Photos renders the Live Photo and provides it to the editing output.
Note
Don’t forget to describe your edits in a PHAdjustment
object and provide that to the adjustment
property of your content editing output. Providing adjustment data allows your app (or photo editing extension) to non-destructively resume working with an edit later, whether on the same device or on another Mac or iOS device using iCloud Photo Library.
After this method’s completion handler signals successful rendering, you use the content editing output to complete the edit. In an app using the Photos framework, create a PHAsset
object inside a PHPhoto
perform
block, and set its content
property to your editing output. In a photo editing extension running in the Photos app, your main view controller provides content editing output when requested by the finish
method.