UIGestureRecognizer

Swift

extension UIGestureRecognizer
  • Convenience initializer that takes a lamda as action.

    Declaration

    Swift

    @objc(initWithName:block:)
    convenience init(name: String?, action: @escaping (_ gesture: UIGestureRecognizer) -> Void)
  • Cancels the current gesture (disables and then re-enables the gesture).

    Declaration

    Swift

    @objc(pspdf_cancel)
    func cancel()
  • Helper for getting the actual initial starting point of the gesture.

    Can be used instead of locationInView: when in the UIGestureRecognizerStateBegan state, to get the location of the first touch the gesture received, instead of the location where the gesture has been detected as started.

    @note If that point hasn’t been determined yet, falls back to the current location.

    @note Only returns the start point if the gesture conforms to PSPDFInitialStartingPointGesture.

    Declaration

    Swift

    @objc(pspdf_initialOrCurrentLocationInView:)
    func initialOrCurrentLocation(in view: UIView) -> CGPoint