SpriteViewController

@available(iOS 9.0, *)
@objc(PESDKSpriteViewController)
open class SpriteViewController : ViewController
extension SpriteViewController: PhotoEditModelSettable
extension SpriteViewController: CanvasViewDataSource
extension SpriteViewController: CanvasViewDelegate

A SpriteViewController is supposed to be added above a PhotoEditPreviewController. It uses the PhotoEditModel to display SpriteViews corresponding to SpriteModels and it reacts to changes in the PhotoEditModel by adding, changing or deleting SpriteViews.

Properties

Initializers

  • Creates a new SpriteViewController object.

    Declaration

    Swift

    public required init(productType: LicenseProduct)

    Parameters

    productType

    The product that this sprite view controller is used in.

Actions

  • Called by a UITapGestureRecognizer to select a sprite. You shouldn’t need to call this method directly.

    Declaration

    Swift

    @objc
    open func tapped(_ gestureRecognizer: UITapGestureRecognizer)

Selection

  • Posts a .PESDKDidSelectSprite notification with the given SpriteView.

    Declaration

    Swift

    open func selectSpriteView(_ spriteView: SpriteView?)

    Parameters

    spriteView

    The sprite view that was selected or nil if no view was selected.

Helpers

  • Returns the SpriteView at a given point, if any.

    Declaration

    Swift

    open func spriteView(at point: CGPoint) -> SpriteView?

    Parameters

    point

    The location to check for a sprite view.

    Return Value

    The sprite view at the given point or nil.

  • Returns the SpriteView with the given UUID, if any.

    Declaration

    Swift

    open func spriteView(with uuid: UUID) -> SpriteView?

    Parameters

    uuid

    The UUID of the sprite view.

    Return Value

    The sprite view with the UUID or nil.

  • This is a boxed property which exposes a Swift struct to Objective-C. This property should only be used if you are using Objective-C.

    Every invocation of the getter will return a new (temporary) object wrapping the underlying Swift struct. Boxed properties cannot be chained with the dot syntax for mutable access of nested properties in place. Use the setter with the assignment operator instead to modify boxed properties, e.g.:

    PESDKPhotoEditModel *photoEditModel = [[PESDKPhotoEditModel alloc] init];
    
    // CORRECT:
    // get boxed `AdjustmentModel`
    PESDKAdjustmentModel *adjustmentModel = photoEditModel.adjustmentModel;
    // modify boxed `AdjustmentModel`
    adjustmentModel.brightness = 0.5;
    // set modified boxed `AdjustmentModel`
    photoEditModel.adjustmentModel = adjustmentModel;
    
    // WRONG:
    photoEditModel.adjustmentModel.brightness = 0.5;
    

    Declaration

    Swift

    var boxedPhotoEditModel: _ObjCPhotoEditModel { get set }