UIAccessibilityContainer in child controllers?

I have a parent UIViewController

to which I add four child controllers. I am trying to control access on all of these controllers. I have an enum status

that keeps track of which of these children is displayed on the screen, so when that changes, I update the accessibilityElementsHidden

children when needed and send a notification LayoutChanged

.

My question has to do with the protocol implementation UIAccessibilityContainer

both in the parent view controller and inside each of the child controllers. The parent needs to know in what order these elements should be presented, etc., and each child has their own elements that also need a specific order.

It looks like inside children, methods UIAccessibilityContainer

( accessibilityElementCount

and others) are never called, so it looks like it ignores them, which leaves my elements out of order and messy.

Is this the way it should be? Can I do something wrong here?

+3


source to share


2 answers


Yes, that's right, what the UIAccessibilityContainer does is tell VoiceOver that this element is the innermost element in terms of accessibility.



Can you give a little more information on what you are trying to do in terms of the user interface, there might be a better way to achieve this.

0


source


The reason your UIAccessibilityContainer methods are not called is because they are defined as part of your view controller. They should be defined as part of your custom view to be called.



I am just digging into UIAccessibility with my own layered view controllers, so I have no answer on how to fix your order. I'll update this post if I can figure it out.

+1


source







All Articles