PanGestureRecognizer

@MainActor
open class PanGestureRecognizer : UIPanGestureRecognizer, UIGestureRecognizerDelegate

自动处理与滚动视图pan手势在指定方向的冲突,默认设置delegate为自身。如果找到滚动视图则处理之,否则同父类

  • 是否自动检测滚动视图,默认true。如需手工指定,请禁用之

    Declaration

    Swift

    @MainActor
    open var autoDetected: Bool
  • 是否按下就立即转换Began状态,默认false,需要等待移动才会触发Began

    Declaration

    Swift

    @MainActor
    open var instantBegan: Bool
  • 指定滚动视图,自动处理与滚动视图pan手势在指定方向的冲突。自动设置默认delegate为自身

    Declaration

    Swift

    @MainActor
    open weak var scrollView: UIScrollView?
  • 指定与滚动视图pan手势的冲突交互方向,默认向下

    Declaration

    Swift

    @MainActor
    open var direction: UISwipeGestureRecognizer.Direction
  • 指定当前手势在指定交互方向的最大识别距离,默认0,无限制

    Declaration

    Swift

    @MainActor
    open var maximumDistance: CGFloat
  • 自定义Failed判断句柄。默认判定失败时直接修改状态为Failed,可设置此block修改判定条件

    Declaration

    Swift

    @MainActor
    open var shouldFailed: ((PanGestureRecognizer) -> Bool)?
  • 自定义shouldBegin判断句柄

    Declaration

    Swift

    @MainActor
    open var shouldBegin: ((PanGestureRecognizer) -> Bool)?
  • 自定义shouldBeRequiredToFail判断句柄

    Declaration

    Swift

    @MainActor
    open var shouldBeRequiredToFail: ((UIGestureRecognizer) -> Bool)?
  • 自定义shouldRequireFailure判断句柄

    Declaration

    Swift

    @MainActor
    open var shouldRequireFailure: ((UIGestureRecognizer) -> Bool)?
  • 获取当前手势在指定交互方向的滑动进度

    Declaration

    Swift

    @MainActor
    open var swipePercent: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    @MainActor
    override public init(target: Any?, action: Selector?)
  • Undocumented

    Declaration

    Swift

    @MainActor
    public convenience init()

Override

  • Undocumented

    Declaration

    Swift

    @MainActor
    override open func reset()
  • Undocumented

    Declaration

    Swift

    @MainActor
    override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent)
  • Undocumented

    Declaration

    Swift

    @MainActor
    override open func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent)

UIGestureRecognizerDelegate

  • Undocumented

    Declaration

    Swift

    @MainActor
    open func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool
  • Undocumented

    Declaration

    Swift

    @MainActor
    open func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool
  • Undocumented

    Declaration

    Swift

    @MainActor
    open func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool
  • Undocumented

    Declaration

    Swift

    @MainActor
    open func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool