Просмотр исходного кода

fix: enforce swipe from edge to back to avoid conflicts

Tienson Qin 3 месяцев назад
Родитель
Сommit
1a9e6508c1
1 измененных файлов с 0 добавлено и 33 удалено
  1. 0 33
      ios/App/App/AppDelegate.swift

+ 0 - 33
ios/App/App/AppDelegate.swift

@@ -12,13 +12,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UINavigationControllerDel
     private var ignoreRoutePopCount = 0
     private var popSnapshotView: UIView?
 
-    private lazy var navigationSwipeGesture: UISwipeGestureRecognizer = {
-        let gesture = UISwipeGestureRecognizer(target: self, action: #selector(handleNavigationSwipe(_:)))
-        gesture.direction = .right
-        gesture.cancelsTouchesInView = false
-        return gesture
-    }()
-
     private func normalizedPath(_ raw: String?) -> String {
         guard let raw = raw, !raw.isEmpty else { return "/" }
         return raw
@@ -302,7 +295,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UINavigationControllerDel
             SharedWebViewController.instance.attach(to: current)
         }
 
-        attachNavigationSwipeGesture()
     }
 
     func navigationController(
@@ -315,31 +307,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UINavigationControllerDel
         return nil
     }
 
-    // ---------------------------------------------------------
-    // MARK: Gestures
-    // ---------------------------------------------------------
-
-    private func attachNavigationSwipeGesture() {
-        guard let nav = navController else { return }
-
-        if let edgePan = nav.interactivePopGestureRecognizer {
-            navigationSwipeGesture.require(toFail: edgePan)
-        }
-        if navigationSwipeGesture.view !== nav.view {
-            nav.view.addGestureRecognizer(navigationSwipeGesture)
-        }
-    }
-
-    @objc private func handleNavigationSwipe(_ gesture: UISwipeGestureRecognizer) {
-        guard gesture.state == .ended else { return }
-        guard let nav = navController else { return }
-
-        if nav.viewControllers.count > 1 {
-            nav.popViewController(animated: true)
-            return
-        }
-    }
-
     // ---------------------------------------------------------
     // MARK: Route Observation
     // ---------------------------------------------------------