Gman9855
Gman9855

Reputation: 487

VoiceOver: UIAccessibilityLayoutChangedNotification not working

Using VoiceOver, UIAccessibility.post(notification: .layoutChanged, argument: someView) just re-announces the currently focused element instead of moving focus and announcing the accessibilityLabel of someView. Even calling UIAccessibility.post(notification: .layoutChanged, argument: "what the heck") does nothing and just re-announces the currently focused element, when it should announce the string passed in as the argument according to the docs. I'm currently running Xcode 11.3.1 on the simulator. Tried on a physical device as well and same problem. Any help would be gladly appreciated :)

Upvotes: 1

Views: 2700

Answers (2)

Gman9855
Gman9855

Reputation: 487

Figured out that this post function only actually focuses on the passed in view when running on a physical device, and seems to be broken on simulator.

Upvotes: 2

Jon Gibbins
Jon Gibbins

Reputation: 1086

It may be that the target element someView is not an Accessibility Element. Check if someView.isAccessibilityElement is set to true.

Upvotes: 0

Related Questions