PhotoEditViewControllerDelegate

@available(iOS 9.0, *)
@objc(PESDKPhotoEditViewControllerDelegate)
public protocol PhotoEditViewControllerDelegate

The PhotoEditViewControllerDelegate protocol defines methods that allow you to respond to the events of an instance of PhotoEditViewController.

  • Called when the output image was generated. If no changes have been applied to an image this will return the original input image and an empty Data instance if the input Photo object was not created with init(data:) or init(url:).

    Declaration

    Swift

    @objc(photoEditViewController:didSaveImage:imageAsData:)
    func photoEditViewController(_ photoEditViewController: PhotoEditViewController, didSave image: UIImage, and data: Data)

    Parameters

    photoEditViewController

    The photo edit view controller that created the output image.

    image

    The output image that was generated.

    data

    The output image that was generated as Data if available.

  • Called when the output image could not be generated.

    Declaration

    Swift

    @objc
    func photoEditViewControllerDidFailToGeneratePhoto(_ photoEditViewController: PhotoEditViewController)

    Parameters

    photoEditViewController

    The photo edit view controller that was unable to generate the output image.

  • Called when the user wants to dismiss the editor.

    Declaration

    Swift

    @objc
    func photoEditViewControllerDidCancel(_ photoEditViewController: PhotoEditViewController)

    Parameters

    photoEditViewController

    The photo edit view controller that is asking to be cancelled.

  • Called when a new tool controller will be pushed onto the tool stack.

    Declaration

    Swift

    @objc
    optional func photoEditViewController(_ photoEditViewController: PhotoEditViewController, willPresentToolController toolController: PhotoEditToolController)

    Parameters

    photoEditViewController

    The photo edit view controller presenting the tool.

    toolController

    The tool being presented.

  • Called when a new tool controller was pushed onto the tool stack.

    Declaration

    Swift

    @objc
    optional func photoEditViewController(_ photoEditViewController: PhotoEditViewController, didPresentToolController toolController: PhotoEditToolController)

    Parameters

    photoEditViewController

    The photo eidt view controller presenting the tool.

    toolController

    The tool that was presented.

  • Called when a tool controller will be popped from the tool stack.

    Declaration

    Swift

    @objc
    optional func photoEditViewController(_ photoEditViewController: PhotoEditViewController, willDismissToolController toolController: PhotoEditToolController)

    Parameters

    photoEditViewController

    The photo edit view controller dismissing the tool.

    toolController

    The tool being dismissed.

  • Called when a tool controller was popped from the tool stack.

    Declaration

    Swift

    @objc
    optional func photoEditViewController(_ photoEditViewController: PhotoEditViewController, didDismissToolController toolController: PhotoEditToolController)

    Parameters

    photoEditViewController

    The photo edit view controller dismissing the tool.

    toolController

    The tool that was dismissed.