Skip to content

Commit 7124c0e

Browse files
committed
Allowing scroll gesture to cancel button presses.
1 parent 8d0e973 commit 7124c0e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

StackViewController/AutoScrollView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ open class AutoScrollView: UIScrollView {
7171
deinit {
7272
NotificationCenter.default.removeObserver(self)
7373
}
74+
75+
open override func touchesShouldCancel(in view: UIView) -> Bool {
76+
guard view.isKind(of: UIButton.self) else { return super.touchesShouldCancel(in: view) }
77+
return true
78+
}
7479

7580
// MARK: Notifications
7681

0 commit comments

Comments
 (0)