I try to call UIAccessibility’s registerGestureConflictWithZoom() but it has no effect. I’m running the code on an iPhone 12 with zoom gesture enabled. (Go to Settings > Accessibility > Zoom, then turn on Zoom.) But I’m not being presented with the choice of turning off Zoom when the app is run.
This, from the documentation, is my situation and what I would like to happen:
Use this function if your application uses multi-finger gestures that conflict with the gestures used by system Zoom (that is, three-finger gestures). When this is the case, the user is presented with the choice of turning off Zoom or continuing.
I have tried to call it from the app init:
import SwiftUI
import UIKit
@main
struct MultiTouchApp: App {
init() {
UIAccessibility.registerGestureConflictWithZoom()
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
From my view init:
import Foundation
import UIKit
class CustomView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
isMultipleTouchEnabled = true
UIAccessibility.registerGestureConflictWithZoom()
}
...
And also here in the view:
override func didMoveToWindow() {
UIAccessibility.registerGestureConflictWithZoom()
}
I’ve also tried (in a separate project with UIKit App Delegate Life Cycle) to make the call from AppDelegates func application.