MediaEditViewController

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKMediaEditViewController)
open class MediaEditViewController : ViewController

A MediaEditViewController is the main starting point for the SDK. It displays the rendered photo and a menu. It can present PhotoEditToolController objects and react to changes. It can be presented on its own (thus displaying a toolbar for navigation at the bottom) or be embedded into a UINavigationController (thus using the navigation controller’s navigation bar for navigation).

  • The undo button that is displayed in the editor.

    Declaration

    Swift

    open private(set) var undoButton: OverlayButton?
  • The redo button that is displayed in the editor.

    Declaration

    Swift

    open private(set) var redoButton: OverlayButton?
  • All overlay buttons that are displayed in the editor. This includes undoButton and redoButtton.

    Declaration

    Swift

    open private(set) var overlayButtons: [OverlayButton]
  • Presents the tool that is represented by the given ToolMenuItem. You must only call this when the editor is already on-screen.

    Declaration

    Swift

    open func presentTool(for toolMenuItem: ToolMenuItem)

    Parameters

    toolMenuItem

    The tool menu item whose represented tool should be presented.

  • Called when the user wants to dismiss the editor.

    Declaration

    Swift

    open func didCancel()
  • Called when a new tool controller will be pushed onto the tool stack.

    Declaration

    Swift

    open func willPresent(_ toolController: PhotoEditToolController)

    Parameters

    toolController

    The tool being presented.

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

    Declaration

    Swift

    open func didPresent(_ toolController: PhotoEditToolController)

    Parameters

    toolController

    The tool that was presented.

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

    Declaration

    Swift

    open func willDismiss(_ toolController: PhotoEditToolController)

    Parameters

    toolController

    The tool being dismissed.

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

    Declaration

    Swift

    open func didDismiss(_ toolController: PhotoEditToolController)

    Parameters

    toolController

    The tool that was dismissed.

  • Applies all changes to the high resolution variant of this media edit view controller’s asset.

    Declaration

    Swift

    open func renderHighResolutionVariant()
  • The tools that are currently on the stack.

    Declaration

    Swift

    open private(set) var viewControllers: [PhotoEditToolController]
  • Pushes a new tool onto the tool stack and presents its view.

    Declaration

    Swift

    @objc(pushViewController:animated:completion:)
    open func push(_ viewController: PhotoEditToolController, animated: Bool, completion: (() -> Void)? = nil)

    Parameters

    viewController

    The tool controller to present.

    animated

    Whether to show this tool animated or not.

    completion

    A closure that is executed after the presentation animation is finished.

  • Pops the top view controller from the stack and removes its view.

    Declaration

    Swift

    @discardableResult
    @objc(popViewControllerAnimated:completion:)
    open func pop(animated: Bool, completion: (() -> Void)? = nil) -> PhotoEditToolController?

    Parameters

    animated

    Whether to animate the transition or not.

    completion

    A closure that is executed after the dismissal animation.

    Return Value

    The tool that was popped from the stack, if any.