I’ve used accessibilityViewIsModal - true
in UIKit where I need to shift accessibility focus from one view to another subview. How to use accessibilityViewIsModal in swiftUI?
I’ve tried following techniques to shift accessibility focus from one view to another subview.
- UIAccessibility.post(notification: .screenChanged, argument: “New Screen appear”)
Result: Accessibility focus didn’t change
- accessibilityViewIsModal = true
Result: Compile time error: Cannot find ‘accessibilityViewIsModal’ in scope
if showSelectPolicyView {
SelectPolicyView(input: $inputData, showSelectPolicyView: $showSelectPolicyView)
.transition(.move(edge: .bottom))
.clipped()
.zIndex(1)
.background(Color.gray)
.onAppear {
accessibilityViewIsModal = true
}.onDisappear() {
accessibilityViewIsModal = true
}
}
Where and how to use accessibilityViewIsModal in swiftUI
?