Stop dragging entire Scene in iOS26

I wrote a Solitaire game earlier this year, it was compiled for iOS15 under a previous version of Xcode.

I just upgrade the SIMULATOR to run iOS26, to test the code…. and found something very irritating.

If I touch and drag on the screen, it MOVES THE ENTIRE SCENE!….. it only moves objects if I touch them, but any empty area moves EVERYTHING. This is NOT a problem for DEVICES running <iOS26, but an iOS26 device does this regardless of the Xcode deployment level

I have spent all day, and every AI says the same thing, but no suggestion even comes close to stopping this…. seems it is a FEATURE not a bug…

up to now this is how I “navigate” thru various screens (pushing and popping the view stack)

public func goto$Next(name:String) {
    //   Note : 23Feb2020 - SplashScreen is destroyed after initial load
    if name != "*" {
        switch name {
            case id$SPLASH   : myNavCtrl!.pushViewController(vc$SPLASH, animated: false)
            case id$SELECT   : myNavCtrl!.pushViewController(vc$SELECT, animated: false)
            case id$BOARD    : myNavCtrl!.pushViewController(vc$BOARD , animated: true)
            case id$OPTIONS  : myNavCtrl!.pushViewController(vc$OPTIONS , animated: true)
            case id$RULES    : myNavCtrl!.pushViewController(vc$RULES , animated: true)
            default: errorMessage("Unknown UIView ID [\(name)]")
        }
    } else {
        myNavCtrl!.popViewController(animated: true)
    }
}
```



After many hours, and hundreds of trial/error , I think I cracked it…

The AI I used said to check interactivePopGestureRecognizer but it should have been interactiveContentPopGestureRecognizer which seems to work, it stops the SCENE window from sliding, but not the desired on-screen objects

override func viewWillAppear(_ animated: Bool) {
   super.viewWillAppear(animated)
   if let popGesture = navigationController?.interactivePopGestureRecognizer {
      popGesture.delegate  = self
      popGesture.isEnabled = true // or false to disable fully
    }
    if let contentPopGesture = myNavCtrl?.interactiveContentPopGestureRecognizer {
       contentPopGesture.delegate  = self
       contentPopGesture.isEnabled = true // or false to disable
     }
}

override func viewWillDisappear(_ animated: Bool) {
   super.viewWillDisappear(animated)
   myNavCtrl?.interactivePopGestureRecognizer?.delegate = nil
}

  // UIGestureRecognizerDelegate method
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
// Disallow gesture recognizer to begin if it is the interactivePopGestureRecognizer
   if gestureRecognizer == myNavCtrl?.interactiveContentPopGestureRecognizer {
      return false // Disable the gesture
   }
   return true
}
2 Likes