File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import UIKit
1010import Dispatch
1111
12- let LOGGING = false
12+ let LOGGING = true
1313
1414let dateFormat = " yyyy-MM-dd hh:mm:ss.SSS "
1515let dateFormatter : DateFormatter = {
@@ -1400,9 +1400,34 @@ private struct ChildScrollViewInfo {
14001400extension DrawerView : UIGestureRecognizerDelegate {
14011401
14021402 override public func gestureRecognizerShouldBegin( _ gestureRecognizer: UIGestureRecognizer ) -> Bool {
1403- if gestureRecognizer === panGestureRecognizer || gestureRecognizer === overlayTapRecognizer {
1403+ if gestureRecognizer === panGestureRecognizer {
1404+ guard enabled else { return false }
1405+
1406+ // Check if the pan gesture is primarily horizontal (like swipe-to-delete)
1407+ // If so, don't begin to allow those gestures to work
1408+ let translation = panGestureRecognizer. translation ( in: self )
1409+ let velocity = panGestureRecognizer. velocity ( in: self )
1410+
1411+ // If there's meaningful translation/velocity, check direction
1412+ if abs ( translation. x) > 0 || abs ( translation. y) > 0 {
1413+ let isHorizontal = abs ( translation. x) > abs ( translation. y)
1414+ if isHorizontal {
1415+ return false
1416+ }
1417+ } else if abs ( velocity. x) > 0 || abs ( velocity. y) > 0 {
1418+ let isHorizontal = abs ( velocity. x) > abs ( velocity. y)
1419+ if isHorizontal {
1420+ return false
1421+ }
1422+ }
1423+
1424+ return true
1425+ }
1426+
1427+ if gestureRecognizer === overlayTapRecognizer {
14041428 return enabled
14051429 }
1430+
14061431 return true
14071432 }
14081433
You can’t perform that action at this time.
0 commit comments