MediaEditViewControllerOptionsBuilder

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKMediaEditViewControllerOptionsBuilder)
open class MediaEditViewControllerOptionsBuilder : NSObject

The default MediaEditViewControllerOptionsBuilder for MediaEditViewControllerOptions.

  • A configuration closure to configure the toolbars title view.

    Declaration

    Swift

    open var titleViewConfigurationClosure: ViewConfigurationClosure?
  • The main view’s background color. Defaults to the configuration’s global background color.

    Declaration

    Swift

    open var backgroundColor: UIColor?
  • The background color of the menu. Defaults to the configuration’s global background color.

    Declaration

    Swift

    open var menuBackgroundColor: UIColor?
  • A configuration closure to configure the apply button displayed at the bottom right. Defaults to a checkmark icon.

    Declaration

    Swift

    open var applyButtonConfigurationClosure: ButtonConfigurationClosure?
  • A configuration closure to configure the discard button displayed at the bottom left. Defaults to a cross icon.

    Declaration

    Swift

    open var discardButtonConfigurationClosure: ButtonConfigurationClosure?
  • This closure allows further configuration of the action buttons. The closure is called for each action button and has the button and its corresponding action as parameters.

    Declaration

    Swift

    open var actionButtonConfigurationClosure: ((MenuCollectionViewCell, PhotoEditMenuItem) -> Void)?
  • This closure is called every time the user selects a menu item.

    Declaration

    Swift

    open var photoEditorActionSelectedClosure: ((PhotoEditMenuItem) -> Void)?
  • When set to true, the user is forced to crop the asset to one of the allowed crop aspects in TransformToolControllerOptions.allowedCropAspects before being able to use other features of the editor. The transform tool will only be presented if the image does not already fit one of those allowed aspect ratios. It will be presented automatically, if the user changes the orientation of the asset and the result does not match an allowed aspect ratio. Defaults to false.

    Attention

    This property has no effect unless TransformToolControllerOptions.allowFreeCrop is set to false.

    Declaration

    Swift

    open var forceCropMode: Bool
  • Controls if the user can zoom the preview image. Defaults to true.

    Declaration

    Swift

    open var allowsPreviewImageZoom: Bool
  • This closure allows further configuration of the overlay buttons. The closure is called for each button and has the button and its corresponding enum value as parameters.

    Declaration

    Swift

    open var overlayButtonConfigurationClosure: ((OverlayButton, MediaEditOverlayAction) -> Void)?
  • Defines all allowed actions. Only buttons for allowed actions are visible. Defaults to show all available actions. To set this property from Obj-C, see the allowedMediaEditOverlayActionsNSNumbers property.

    Declaration

    Swift

    open var allowedMediaEditOverlayActions: [MediaEditOverlayAction]
  • This closure is called when the user selects an overlay action.

    Declaration

    Swift

    open var mediaEditOverlayActionSelectedClosure: ((MediaEditOverlayAction) -> Void)?
  • The undo/redo buttons in the MediaEditViewController have two different modes of operation: If this property is true (the default) each operation will be undone individually. So for example if you draw 3 strokes in the brush tool and move a sticker around twice in the sticker options tools, you’d have to tap ‘undo’ 5 times to undo everything. If this property is false all modifications that have been made within a single tool will be grouped together and undone in one step. In the above example that means that you’d only have to tap ‘undo’ 2 times to undo everything (once for the changes within the sticker options tool and once for the changes within the brush tool).

    Declaration

    Swift

    open var undoStepByStep: Bool
  • If set this closure is called when the user taps the discard button while changes to the image are applied. You can for example use this to present an alert view informing the user that he is about to lose his changes. You have to call the passed closure when you have confirmation by the user to continue with program execution. By default it is set to present an UIAlertController.

    Declaration

    Swift

    open var discardConfirmationClosure: ((MediaEditViewController, @escaping () -> Void) -> Void)? = { mediaEditViewController, confirmation in
  • When a MediaEditViewController is part of a custom container view controller, which is presented in an UINavigationController, the MediaEditViewController will not be able to update the navigation controller’s navigation bar by default because that is the job of the immediate child of the navigation controller. Setting this property to true will update the parent view controller’s navigation item instead of its own navigation item to be able to use the navigation bar even when embedded in a custom container view controller. Default value is false.

    Declaration

    Swift

    @available(*, deprecated, renamed: "navigationControllerMode", message: "Use `navigationControllerMode = .useNavigationBarAndParentNavigationItem` instead.")
    public var useParentNavigationItem: Bool { get set }
  • This option defines the behavior if a MediaEditViewControlleror one of its ancestors is a child of a UINavigationController. Default is NavigationControllerMode.useNavigationBar.

    Declaration

    Swift

    open var navigationControllerMode: NavigationControllerMode
  • The insets used to layout the overlay buttons in their container. The .top value is ignored.

    Declaration

    Swift

    open var overlayButtonInsets: UIEdgeInsets
  • The menu items (or tools) to display in the main menu. Default is PhotoEditMenuItem.defaultItems.

    Declaration

    Swift

    open var menuItems: [PhotoEditMenuItem]
  • Creates a new instance of MediaEditViewControllerOptionsBuilder initialized with the given options.

    Declaration

    Swift

    public init(options: MediaEditViewControllerOptions)

    Parameters

    options
  • This closure allows further configuration of the action buttons. The closure is called for each action button and has the button and its corresponding action as parameters.

    Declaration

    Swift

    open var actionButtonConfigurationBlock: ((MenuCollectionViewCell, _ObjCPhotoEditMenuItem) -> Void)? { get set }
  • This closure is called every time the user selects a menu item.

    Declaration

    Swift

    open var photoEditorActionSelectedBlock: ((_ObjCPhotoEditMenuItem) -> Void)? { get set }
  • An array of MediaEditOverlayAction raw values wrapped in NSNumbers. Setting this property overrides any previously set values in allowedMediaEditOverlayActions with the corresponding MediaEditOverlayAction values.

    Declaration

    Swift

    @objc(allowedMediaEditOverlayActions)
    open var _objCAllowedMediaEditOverlayActions: [NSNumber] { get set }
  • The menu items (or tools) to display in the main menu. Default is PhotoEditMenuItem.defaultItems.

    Declaration

    Swift

    @objc(menuItems)
    open var _objCMenuItems: [_ObjCPhotoEditMenuItem] { get set }