Skip to content

Commit 4093c65

Browse files
committed
add isUserInteractionEnabled to uivew gestures
1 parent 7cb6ed6 commit 4093c65

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/DeclarativeLayoutKit/Chaining/Actions/UIView+Gesture.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public extension UIView {
1212
/// **⚠️ Don't forget about ARC when use self or some parent view in action closure, to prevent retain cycle**
1313
@discardableResult
1414
func onTapGesture(overwrite: Bool = false, _ action: @escaping () -> ()) -> Self {
15+
isUserInteractionEnabled = true
1516
if overwrite {
1617
gestureRecognizers?.removeAll(where: { (gesture: UIGestureRecognizer) in gesture is UITapGestureRecognizer })
1718
}
@@ -24,6 +25,7 @@ public extension UIView {
2425
/// **⚠️ Don't forget about ARC when use self or some parent view in action closure, to prevent retain cycle**
2526
@discardableResult
2627
func onLongTapGesture(overwrite: Bool = false, _ action: @escaping () -> ()) -> Self {
28+
isUserInteractionEnabled = true
2729
if overwrite {
2830
gestureRecognizers?.removeAll(where: { (gesture: UIGestureRecognizer) in gesture is UILongPressGestureRecognizer })
2931
}

0 commit comments

Comments
 (0)