If you press firmly on the left edge of the screen using an iPhone with 3D touch you will bring up the task switcher.
I'd like to know how I can disable this behavior in my app.
If you press firmly on the left edge of the screen using an iPhone with 3D touch you will bring up the task switcher.
I'd like to know how I can disable this behavior in my app.
There is no API for that, just as there isn’t one for disabling any other way of getting out of your app. If you’d like such a thing, you can file an enhancement request with a description of what you’re trying to do.
While there isn't an API for this, it appears that the behavior is constrained to Portrait mode. If you run Apple's TouchCanvas example, you'll see that the gesture doesn't actually work because the app runs in Landscape mode. If you modify the project to support both Portrait and Landscape, you can see the gesture is enabled in Portrait, and disabled in Landscape.
So, that may be a suitable workaround, depending on your use case.
I've filed a Radar for this at https://bugreport.apple.com, suggesting that Apple offers an API similar to being able to set:
self.navigationController?.interactivePopGestureRecognizer.enabled = false
and would suggest that you do the same if seeing the feature is of interest to you. They'll probably close duplicates, but voicing more support couldn't hurt.
© 2022 - 2024 — McMap. All rights reserved.