In order to open the editor you can either use the
PhotoEditorModal as shown in this example or use the callable static function
PESDK.openEditor. For reference to the last method, please take a look at the dedicated guides here.
Create a PhotoEditorModal#
PhotoEditorModal represents a modally presented editor, you need to handle its visibility by using its
visible is set to
true, the editor will be modally presented.
onExport property allows us to register an event handler that is invoked when a user successfully exports an edited photo. The
result argument passed to the closure is of type
PhotoEditorResult and contains the data of the exported photo.
onCancel handler is called if the user cancels the editing process by clicking the cancel button inside the editor. If the export fails the
onError handler is called.
In each of these cases, you need to reset the
visible property of the modal to
In this example, this is handled by the custom