How to make custom UIView accessible?

I have a custom UIView subclass that contains a grid of cells, each of which is also a regular UIView subclass.

I'm interested in using the Keep It Functional functional test environment, which requires an acccessibilityLabel on each view.

How to configure cell classes for availability shortcuts, so I can refer to them separately in my tests?

+4
source share
1 answer

I think my auto-regiment lied to me. All I needed to do:

[gridCell setIsAccessibilityElement:YES]; [gridCell setAccessibilityLabel:[NSString stringWithFormat:@"cell-%d", cellIndex]]; 
+9
source

Source: https://habr.com/ru/post/1397140/


All Articles