PhotoEditPreviewController

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKPhotoEditPreviewController)
open class PhotoEditPreviewController : ViewController

The PhotoEditPreviewController is responsible for previewing changes to a photo and displaying the image in a scrollable container. It is passed a full resolution UIImage object and handles downscaling automatically.

  • The scroll view that hosts the preview view.

    Declaration

    Swift

    open private(set) lazy var previewViewScrollingContainer: UIScrollView { get set }
  • The preview view that renders the preview image.

    Declaration

    Swift

    open private(set) lazy var previewView: UIView { get set }
  • Whether zooming should be enabled.

    Declaration

    Swift

    open var allowsPreviewImageZoom: Bool
  • An object that acts as a delegate.

    Declaration

    Swift

    open weak var delegate: PhotoEditPreviewControllerDelegate?
  • The photo edit model that is currently being rendered.

    Declaration

    Swift

    open var photoEditModel: PhotoEditModel { get set }
  • The UIImage object used in the preview. This is the resized version of the original photo. Setting this also generates the matching CIImage object, see baseWorkCIImage.

    Declaration

    Swift

    open private(set) var baseWorkUIImage: UIImage? { get set }
  • The CIImage object used in the preview. This is the resized version of the original photo.

    Declaration

    Swift

    open private(set) var baseWorkCIImage: CIImage?
  • The renderer that is being used to render the image.

    Declaration

    Swift

    public let renderer: PhotoEditRenderer
  • The SpriteViewController that is displayed above the preview to manage sprites.

    Declaration

    Swift

    open private(set) lazy var spriteViewController: SpriteViewController { get set }
  • The AssetManager that this view controller can use to set and get assets.

    Declaration

    Swift

    open var assetManager: AssetManager?
  • The UndoController that handles undo/redo for this controller.

    Declaration

    Swift

    open var undoController: UndoController?
  • This closure is called with false when the view controller starts loading its base image and is called again with true when loading has finished. This should be used to display a progress indicator and disable user interaction.

    Declaration

    Swift

    open var loadingProgressClosure: ((Bool) -> Void)?
  • Creates a newly initialized photo edit preview controller for the given photo and the given photo edit model.

    Declaration

    Swift

    public required convenience init(photoAsset: Photo, photoEditModel: PhotoEditModel = PhotoEditModel())

    Parameters

    photoAsset

    The photo to preview.

    photoEditModel

    The photo edit model to render.

  • Updates the layout of the preview. This must be called whenever a new tool is presented above the preview.

    Declaration

    Swift

    open func updateLayout()
  • Updates the insets of the preview. This must be called whenever a new tool is presented above the preview.

    Declaration

    Swift

    open func updateInsets(animated: Bool)

    Parameters

    animated

    Whether this change should be animated or not.

  • Triggers a rerender of the preview.

    Declaration

    Swift

    open func updatePreview()
  • Creates a newly initialized photo edit preview controller for the given photo and the given photo edit model.

    Declaration

    Swift

    public convenience init(photoAsset: Photo, photoEditModel: _ObjCPhotoEditModel)

    Parameters

    photoAsset

    The photo to preview.

    photoEditModel

    The photo edit model to render.