Enabling Accessibility

The Enabled check box controls whether a UIKit view works with VoiceOver. To declare an element’s accessibility support, set the isAccessibilityElement property to YES in code or check the Accessibility Enabled box in IB (see Figure 15-1). This Boolean property allows GUI elements to participate in the accessibility system. By default, all UIControl instances inherit the value YES.

As a rule, enable accessibility unless the view is a container whose subviews need to be accessible. Enable only the items at the most direct level of interaction or presentation. Views that organize other views don’t play a meaningful role in the voice presentation. Exclude them.

Table view cells offer a good example of accessibility containers ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.