Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make a custom UIView accessible?

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

I'm interested in using the Keep It Functional test framework, which requires that every view have an acccessibilityLabel.

How do I configure the cell classes to have accessibility labels, so I can refer to them individually in my tests?

like image 614
Bill Avatar asked Feb 18 '12 01:02

Bill


1 Answers

I think my autocomplete was lying to me. All I had to do was:

[gridCell setIsAccessibilityElement:YES];
[gridCell setAccessibilityLabel:[NSString stringWithFormat:@"cell-%d", cellIndex]];
like image 133
Bill Avatar answered Oct 14 '22 13:10

Bill