0

I have a custom UIView which I have implemented the informal protocol UIAccessibilityContainer.

My accessibility elements for this UIView differs depending on the state of the view. In my case it's a player, so when it's playing it has a stop button and when it's stopped it has a play button.

Therefore I dynamically need to update the accessibilityElements array when the state of my view changes.

When the view is initially setup it works as expected but when I need to update the accessibilityElements I don't know how to go about it, and if there's a method to tell "accessibility" that the elements have been updated?

Peter Warbo
  • 11,136
  • 14
  • 98
  • 193

1 Answers1

1

Indeed, there is. You'll want to post a "Layout Changed" notification:

UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, elementToFocusOrNil);

Justin
  • 20,509
  • 6
  • 47
  • 58