SpriteGestureController

@available(iOS 9.0, *)
@objcMembers
open class SpriteGestureController<SpriteModelType, SpriteSelectionView> : NSObject, UIGestureRecognizerDelegate where SpriteModelType : SpriteModel, SpriteSelectionView : UIView

The SpriteGestureController adds pan, pinch and rotate gestures to sprites. It is intended to be an abstract class, with StickerGestureController and TextGestureController as concrete implementations.

Properties

  • The tap gesture recognizer that is used to detect selections.

    Declaration

    Swift

    public let tapGestureRecognizer: UITapGestureRecognizer
  • The pan gesture recognizer that is used to detect moves.

    Declaration

    Swift

    public let panGestureRecognizer: UIPanGestureRecognizer
  • The pinch gesture recognizer that is used to detect resizes.

    Declaration

    Swift

    public let pinchGestureRecognizer: UIPinchGestureRecognizer
  • The rotation gesture recognizer that is used to detect rotation.

    Declaration

    Swift

    public let rotationGestureRecognizer: UIRotationGestureRecognizer
  • The view in which gestures are detected.

    Declaration

    Swift

    public let workspaceView: UIView
  • The view which visualizes vertical snap guides.

    Declaration

    Swift

    open private(set) lazy var verticalSnapGuide: SnapGuideView { get set }
  • The view which visualizes horizontal snap guides.

    Declaration

    Swift

    open private(set) lazy var horizontalSnapGuide: SnapGuideView { get set }
  • The view which visualizes rotation snap guides.

    Declaration

    Swift

    open private(set) lazy var rotationSnapGuide: SnapGuideView { get set }
  • The view which visualizes the sprite’s content bounding box.

    Declaration

    Swift

    open private(set) lazy var spriteSnapGuide: SnapGuideView { get set }
  • Whether tap is enabled, true by default.

    Declaration

    Swift

    open var isTapEnabled: Bool { get set }
  • A view that is displayed around the selected sprite view to indicate selection.

    Declaration

    Swift

    open var spriteSelectionView: SpriteSelectionView?
  • The model of the sprite that is currently selected.

    Declaration

    Swift

    open var spriteModel: SpriteModelType? { get set }
  • An object that acts as the delegate.

    Declaration

    Swift

    open weak var delegate: SpriteGestureControllerDelegate?

Initializers

  • Creates a new SpriteGestureController for the given view.

    Declaration

    Swift

    public required init(workspaceView: UIView)

    Parameters

    workspaceView

    The view in which gestures are detected.