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 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?
  • An array of MenuItem with items that should be presented in the menu.

    Declaration

    Swift

    public let menuItems: [MenuItem]
  • 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?