Platforms to show: All Mac Windows Linux Cross-Platform

Back to PHLivePhotoEditingContextMBS class.

PHLivePhotoEditingContextMBS.cancel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Aborts any Live Photo processing in progress.

This method applies only after you’ve begun processing a Live Photo for display or output with the initWithLivePhotoEditingInput or saveLivePhotoToOutput method. After you call this method, Photos calls your completion handler and provides an error with the PHLivePhotoEditingErrorCodeAborted error code.

PHLivePhotoEditingContextMBS.Constructor(livePhotoInput as PHContentEditingInputMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates a Live Photo editing context for the specified editing input.

livePhotoInput: A content editing input object representing the Live Photo for which to perform editing.

Returns a new Live Photo editing context, or nil if the provided content editing input does not represent a Live Photo.

In an app using the Photos framework, you obtain a PHContentEditingInputMBS object by calling requestContentEditingInputWithOptions method of a PHAssetMBS object that you’ve previously fetched.
In a photo editing extension that runs within the Photos app, your extension’s main view controller (which adopts the PHContentEditingController protocol) receives a PHContentEditingInputMBS object when the user chooses to edit a Live Photo with your extension.

You can create a Live Photo editing context only from PHContentEditingInputMBS object that represents a Live Photo. Use the livePhoto property of the editing input to verify that it has live Photo content.

PHLivePhotoEditingContextMBS.prepareLivePhotoForPlayback(targetSize as CGSizeMBS, options as Dictionary = nil, completionHandler as PrepareLivePhotoForPlaybackCompletedMBS, tag as variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Processes a Live Photo with your edits for viewing.

targetSize: The size of the view in which you plan to preview the edited Live Photo output.
options: Options that affect Live Photo rendering. See Live Photo Processing Options.

Use this method to generate preview versions of the edited Live Photo—for example, to display in your editing UI.

PHLivePhotoEditingContextMBS.saveLivePhotoToOutput(ContentEditingOutput as PHContentEditingOutputMBS, options as Dictionary = nil, completionHandler as PrepareLivePhotoForPlaybackCompletedMBS, tag as variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Processes and saves a full-quality Live Photo as the output of your editing session.

output: The photo editing output to receive the rendered Live Photo, created from the same PHContentEditingInputMBS object you used to begin this Live Photo editing context.
options: Options that affect Live Photo rendering. See Live Photo Processing Options.

Use this method when you have finished an editing session and need to provide rendered output in a PHContentEditingOutputMBS object. Unlike when rendering output for a photo or video asset, you don’t need to provide rendered output using the renderedContentURL property of the editing output object. Instead, create a PHContentEditingOutputMBS object using the Constructor initializer, passing the same PHContentEditingInputMBS object you used in the FrameProcessing delegate 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.

Don’t forget to describe your edits in a PHAdjustmentDataMBS object and provide that to the adjustmentData 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 PHAssetChangeRequestMBS object inside a changes, and set its contentEditingOutput 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 finishContentEditing method.

PHLivePhotoEditingContextMBS.SetFrameProcessor(FrameProcessor as FrameProcessorMBS, tag as variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Sets a delegate to be called by Photos for processing each frame of the Live Photo’s visual content.

Use this property to define the image processing to be performed on each frame of the Live Photo. Setting this property does not begin processing; instead, after you call one of the methods listed in Processing an Editing Context’s Live Photo, Photos executes your block repeatedly to process each frame of the Live Photo’s video and still photo content.

In your frame processor block, use the image property of the provided PHLivePhotoFrameMBS object to access the image to be processed, and return a CIImageMBS object representing the result of your processing. For example, the following code sets up a processor block to apply a simple sepia-tone filter, then calls the saveLivePhotoToOutput method to begin processing the Live Photo for output.

The items on this page are in the following plugins: MBS Mac64bit Plugin.


The biggest plugin in space...