Recipe: Working with Sections

Many iOS applications use sections as well as rows. Sections provide another level of structure to lists, grouping items together into logical units. The most commonly used section scheme is alphabetic, although you are certainly not limited to organizing your data this way. You can use any section scheme that makes sense for your application.

Figure 9-6 shows a table that uses sections to display grouped names. Each section presents a separate header (that is, “Crayon names starting with . . . ”), and an index on the right offers quick access to each of the sections. Notice that there are no sections listed for K, Q, X, and Z in the index because those sections are empty. You generally want to omit empty sections ...

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.