Reputation: 2570
In my app, I have a view that cycles through a number of images. Non-VoiceOver users are able to swipe over the view in order to move backward or forward in the list of images. I've used the UIAccessibilityContainer protocol to properly fill this with accessibility elements so that VoiceOver users are able to "hear" all the items in this set by going through them with the one-finger next/previous item gestures.
What I can't figure out is how to update the image in the UI based on these events. Now, I realize VoiceOver is geared towards blind users and it's probably not a huge deal if the UI doesn't update, but some VoiceOver users are only partly blind, and it's a point of performing the correct behavior regardless.
Is there a way to tell when the user has selected a different element in an accessibility container so that I can update the UI accordingly?
Upvotes: 2
Views: 569
Reputation: 1646
Could the UIAccessibilityFocus Protocol be what you're looking for? Specifically accessibilityElementDidBecomeFocused
? I would guess each element in your container should get this called when VoiceOver moves focus to them.
Upvotes: 2