SwiftUI Set Accessibility Focus for VoiceOver

When a user selects a new tab in a TabView via VoiceOver, the focus remains at the tab button, which is not an ideal user experience. With UIKit I could use:

UIAccessibility.post(notification: .screenChanged, argument: UIView)

to update focus; however, I can't figure out how to do something similar using SwiftUI. Is there an analogue or work around using SwiftUI, or does these ability just not exist yet?

Answered by ForumsContributor in
Accepted Answer

There is a new AccessibilityFocusState API for this, in the new OSs currently in beta.

I have a similar issue. I am working with SwiftUI on ios 13 and 14. Struggling to find the counterpart of "UIAccessibility.post(notification: .screenChanged, argument: UIView)" for SwiftUI.

SwiftUI Set Accessibility Focus for VoiceOver
 
 
Q