BlocklyPanGestureRecognizer

@objcMembers open class BlocklyPanGestureRecognizer: UIGestureRecognizer

The blockly gesture recognizer, which detects pan gestures on blocks in the workspace.

  • The states of the individual touches in the BlocklyPanGestureRecognizer

    Declaration

    Swift

    public enum TouchState: Int
  • Returns the first touch that’s been captured by this gesture recognizer, if it exists.

    Declaration

    Swift

    open var firstTouch: UITouch?
  • Maximum number of touches handled by the recognizer

    Declaration

    Swift

    open var maximumTouches = Int.max
  • The minimum distance for the gesture recognizer to count as a pan, in the UIView coordinate system.

    Declaration

    Swift

    open var minimumPanDistance: Float = 2.0
  • The delegate this gestureRecognizer operates on (WorkbenchViewController by default).

    Declaration

    Swift

    open weak var targetDelegate: BlocklyPanGestureRecognizerDelegate?
  • Called when touches begin on the workspace.

    Declaration

    Swift

    open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent)
  • Called when touches are moved on the workspace.

    Declaration

    Swift

    open override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent)
  • Called when touches end on a workspace.

    Declaration

    Swift

    open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent)
  • Called when touches are cancelled on a workspace.

    Declaration

    Swift

    open override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent)
  • Called when the gesture recognizer terminates (ended, cancelled, or failed.) Cleans up internal references.

    Declaration

    Swift

    open override func reset()
  • Manually cancels the touches of the gesture recognizer.

    Declaration

    Swift

    public func cancelAllTouches()
  • Calculates the delta of the first touch in a given view.

    Declaration

    Swift

    open func firstTouchDelta(inView view: UIView?) -> CGPoint

    Return Value

    The difference between the current position and the previous position.

  • Updates the block at the given index, when the BlockView has changed (typically when it is copied to a new workspace.)

    Declaration

    Swift

    open func replaceBlock(_ block: BlockView, with newBlock: BlockView)
  • Checks if any touch handled by the gesture recognizer is inside a given view.

    Declaration

    Swift

    open func isTouchingView(_ view: UIView) -> Bool