PhotoEditViewController
@objc(PESDKPhotoEditViewController) open class PhotoEditViewController: UIViewController
A PhotoEditViewController
is responsible for presenting and rendering an edited image.
-
The scroll view that hosts the preview view.
Declaration
Swift
fileprivate(set) open var previewViewScrollingContainer: UIScrollView?
-
The preview view that renders the preview image.
Declaration
Swift
fileprivate(set) open var mainPreviewView: GLKView?
-
Set this property to the value returned by
serializedSettings
to restore those serialized settings. This needs to be set before presenting the view controller. Setting this at a later time results in undefined behavior.Declaration
Swift
open var initialSerializedSettings: NSData?
-
The toolbar item for this controller. - seealso:
ToolbarItem
.Declaration
Swift
fileprivate(set) open lazy var toolbarItem: ToolbarItem = DefaultToolbarItem()
-
The
UndoController
associated with this photo edit view controller. This instance is automatically passed to the tool controllers.Declaration
Swift
open lazy var undoController = UndoController()
-
The controller that manages sprites and hosts the sprite container view.
Declaration
Swift
private(set) open var spriteController: SpriteController?
-
The identifier of the photo effect to apply to the photo immediately. This is useful if you pass a photo that already has an effect applied by the
CameraViewController
. Note that you must set this property before presenting the view controller.Declaration
Swift
open var initialPhotoEffectIdentifier: String?
-
The intensity of the photo effect that is applied to the photo immediately. See
initialPhotoEffectIdentifier
for more information.Declaration
Swift
open var initialPhotoEffectIntensity: CGFloat?
-
The delegate for this photo edit view controller. You should set this delegate to respond to save events and errors.
Declaration
Swift
public weak var delegate: PhotoEditViewControllerDelegate?
-
The currently active tool controller, if any.
Declaration
Swift
public var activeTool: PhotoEditToolController?
-
Creates a newly initialized photo edit view controller for the given data object with a default configuration. The data object should represent an image either in JPG or PNG format. Use this initializer to preserve EXIF data.
Declaration
Swift
public required convenience init(data: Data)
Parameters
data
The data of the photo to edit, either in JPG or PNG format.
-
Creates a newly initialized photo edit view controller for the given photo with a default configuration.
Declaration
Swift
public required convenience init(photo: UIImage)
Parameters
photo
The photo to edit.
-
Creates a newly initialized photo edit view controller for the given photo with the given configuration options.
Declaration
Swift
public convenience init(photo: UIImage, configuration: Configuration)
Parameters
photo
The photo to edit.
configuration
The configuration options to apply.
-
Creates a newly initialized photo edit view controller for the given data object with the given configuration. The data object should represent an image either in JPG or PNG format. Use this initializer to preserve EXIF data.
Declaration
Swift
public convenience init(data: Data, configuration: Configuration)
Parameters
data
The data of the photo to edit, either in JPG or PNG format.
configuration
The configuration options to apply.
-
Creates a newly initialized photo edit view controller for the given photo with the given configuration options and the given tools.
Declaration
Swift
public init(photo: UIImage, menuItems: [MenuItem], configuration: Configuration)
Parameters
photo
The photo to edit.
menuItems
The menu items to display.
configuration
The configuration options to apply.
-
Creates a newly initialized photo edit view controller for the given data object with the given configuration and the given tools. The data object should represent an image either in JPG or PNG format. Use this initializer to preserve EXIF data.
Declaration
Swift
public init(data: Data, menuItems: [MenuItem], configuration: Configuration)
Parameters
data
The data of the photo to edit, either in JPG or PNG format.
menuItems
The menu items to display.
configuration
The configuration options to apply.
-
Applies all changes to the photo and passes the edited image to the
delegate
.Declaration
Swift
open func save(_ sender: AnyObject?)
Parameters
sender
The object that initiated the request.
-
Discards all changes to the photo and calls the
delegate
.Declaration
Swift
open func cancel(_ sender: AnyObject?)
Parameters
sender
The object that initiated the request.
-
Creates a photo edit view controller with the given boxed menu items. This initializer should only be used with Objective-C.
Declaration
Swift
public convenience init(photo: UIImage, menuItems: [_ObjCMenuItem], configuration: Configuration)
Parameters
photo
The photo to edit.
menuItems
The menu items to display.
configuration
The configuration options to apply.
-
The intensity of the photo effect that is applied to the photo immediately. See
initialPhotoEffectIdentifier
for more information.Declaration
Swift
public var initialPhotoEffectIntensityAsNSNumber: NSNumber?
-
Returns a JSON as NSData, that contains all the settings regarding the rendering. I.e. what filter has been selected, what stickers were added and such.
Declaration
Swift
public var serializedSettings: NSData?