iphonecocoa-touchkif-framework

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?


Solution

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

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