PhotoEditViewControllerOptionsBuilder
@available(iOS 9.0, *)
@objcMembers
@objc(PESDKPhotoEditViewControllerOptionsBuilder)
open class PhotoEditViewControllerOptionsBuilder : NSObject
The default PhotoEditViewControllerOptionsBuilder
for PhotoEditViewControllerOptions
.
-
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: ((IconCaptionCollectionViewCell, 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 photo to one of the allowed crop aspects inTransformToolControllerOptions.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 photo and the resulting image does not match an allowed aspect ratio. Defaults tofalse
.Attention
This property has no effect unlessTransformToolControllerOptions.allowFreeCrop
is set tofalse
.Declaration
Swift
open var forceCropMode: Bool
-
Controls if the user can zoom the preview image. Defaults to
true
.Declaration
Swift
open var allowsPreviewImageZoom: Bool
-
The image file format of the generated high resolution image. Default is
.jpeg
.Declaration
Swift
open var outputImageFileFormat: ImageFileFormat
-
The compression quality to use when creating the output image. Default is
0.9
. This will only be used if a lossy image file format was specified inoutputImageFileFormat
.Declaration
Swift
open var compressionQuality: CGFloat
-
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, PhotoEditOverlayAction) -> 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
allowedPhotoEditOverlayActionsNSNumbers
property.Declaration
Swift
open var allowedPhotoEditOverlayActions: [PhotoEditOverlayAction]
-
This closure is called when the user selects an overlay action.
Declaration
Swift
open var photoEditOverlayActionSelectedClosure: ((PhotoEditOverlayAction) -> Void)?
-
The undo/redo buttons in the
PhotoEditViewController
have two different modes of operation: If this property istrue
(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 isfalse
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: ((PhotoEditViewController, @escaping () -> Void) -> Void)? = { photoEditViewController, confirmation in
-
When a
PhotoEditViewController
is part of a custom container view controller, which is presented in anUINavigationController
, thePhotoEditViewController
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 totrue
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 isfalse
.Declaration
Swift
open var useParentNavigationItem: Bool
-
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: ((IconCaptionCollectionViewCell, _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
PhotoEditOverlayAction
raw values wrapped in NSNumbers. Setting this property overrides any previously set values inallowedPhotoEditOverlayActions
with the correspondingPhotoEditOverlayAction
values.Declaration
Swift
open var allowedPhotoEditOverlayActionsAsNSNumbers: [NSNumber] { get set }