SpriteViewController
@available(iOS 9.0, *)
@objc(PESDKSpriteViewController)
open class SpriteViewController : ViewController
A SpriteViewController
is supposed to be added above a PhotoEditPreviewController
.
It uses the PhotoEditModel
to display SpriteView
s corresponding to SpriteModel
s and it
reacts to changes in the PhotoEditModel
by adding, changing or deleting SpriteView
s.
-
An object that acts as a delegate.
Declaration
Swift
open weak var delegate: SpriteViewControllerDelegate?
-
The
SpriteContainerView
that this view controller uses.Declaration
Swift
open var spriteContainerView: SpriteContainerView { get }
-
The
AssetManager
that this view controller can use to set and get assets.Declaration
Swift
open var assetManager: AssetManager?
-
The size of the untransformed preview image. This is used to denormalize the normalized values.
Declaration
Swift
open var referenceSize: CGSize { get set }
-
The size of the transformed preview image. This is used to calculate the position within the view.
Declaration
Swift
open var currentSize: CGSize { get set }
-
The photo edit model.
Declaration
Swift
open var photoEditModel: PhotoEditModel { get set }
-
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)
-
Posts a
.PESDKDidSelectSprite
notification with the givenSpriteView
.Declaration
Swift
open func selectSpriteView(_ spriteView: SpriteView?)
Parameters
spriteView
The sprite view that was selected or
nil
if no view was selected.
-
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 givenUUID
, 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
ornil
.