Recipe: Creating Checked Table Cells

Accessory views expand normal UITableViewCell functionality. Check marks create interactive one-of-n or n-of-n selections, as shown in Figure 9-3. With these kinds of selections, you can ask your users to pick what they want to have for dinner or choose which items they want to update.

Image

Figure 9-3 Check mark accessories offer a convenient way of making one-of-n or n-of-n selections from a list.

To check an item, use the UITableViewCellAccessoryCheckmark accessory type. Unchecked items use the UITableViewCellAccessoryNone variation. You set these by assigning the cell’s accessoryType property.

Cells have no ...

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.