Search code examples
iosswiftxcodestoryboarduiaccessibility

iOS accessibility fields grouped by View


As I understand it the accessibility tool on iOS reads top down and left to right. Is there a way to group by view so that two views next to each other at equal height (one on the right and one on the left) will not have their respective elements read together (right left, right left) but rather all the right view's elements followed by the left view's elements?


Solution

  • Using the UIAccessibilityContainer protocol and especially the shouldGroupAccessibilityElement instance property may help you grouping all the accessible elements to be read out by VoiceOver in a specific order. 👍

    I suggest to take a look at this good example including {code snippet (ObjC;Swift) + illustration} that highlights the way to spell out a numeric keypad following a predetermined sequence. 😉