Skip to content

Commit

Permalink
passthrough long press gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Sep 12, 2022
1 parent 1ca064c commit 34028c5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/UIComponent/Components/View/TappableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ open class TappableView: ComponentView {
}
}

public var onLongPress: ((TappableView) -> Void)? {
public var onLongPress: ((TappableView, UILongPressGestureRecognizer) -> Void)? {
didSet {
if onLongPress != nil {
addGestureRecognizer(longPressGestureRecognizer)
Expand Down Expand Up @@ -149,9 +149,7 @@ open class TappableView: ComponentView {
}

@objc open func didLongPress() {
if longPressGestureRecognizer.state == .began {
onLongPress?(self)
}
onLongPress?(self, longPressGestureRecognizer)
}
}

Expand Down

0 comments on commit 34028c5

Please sign in to comment.