Open mlilek-nyt opened 7 years ago
@mlilek-nyt Hey Matt - I tried to reproduce it and got some sample app up here:
TextureAccessibilityViewHierarchy.zip
I'm not pretty sure if this reflects the kind of the view hierarchy you have (I don't use a collection node, instead I just use a plain node for it. From the Xcode accessibility tool it seems all fine and it reaches down to the UISegmentedControl, but could you double check and I would appreciate if you tweak it so it would reflect more the state on your side.
Thanks!
A certain node hierarchy in my app is inaccessible to VoiceOver and everything I've found doesn't actually allow me to make it accessible.
I have an
ASViewController
displaying anASCollectionNode
. We return an instance ofMyCustomASCellNodeSubclass
as a supplementary node forUICollectionElementKindSectionHeader
. A subnode of this contains a nativeUISegmentedControl
.Our node hierarchy ends up as:
And the resulting view hierarchy for the collection header:
The issue is that when iOS's accessibility code walks the view hierarchy for accessibility elements, the
UICollectionReusableView
defers to theMyCustomASCellNodeSubclass-View
.CollectAccessibilityElementsForView
kicks in and starts collecting accessibility elements fromMyCustomASDisplayNodeSubclass
.Because this node isn't layer backed, at best this function will add
MyCustomASDisplayNodeSubclass-View
as an accessibility element. But that view doesn't contain any accessibility elements. And because this function is only adding the view as an accessibility element and not asking the node itself for any accessibility elements (just asking eitherisAccessibilityElements
or checkingaccessibilityElementCount
), I can't hoist up theUISegmentedControl
's accessibility elements.Am I missing something here? Found this using 2.2, but is still an issue even after upgrading to 2.3.1. Not sure the easiest way to build a sample project, but hopefully this is enough information to allow someone to easily reproduce it. We're not doing anything special in our collection node and the two
MyCustomFooSubclass
es are pretty much just configuring the segmented control and specifying a layout spec.Please let me know if there's any other info I can provide!