Recipe: A Core Data–Powered Collection View

It takes work to convert Recipe 12-3 from a table to a collection view, but it doesn’t take an overwhelming amount. Ditch the search view controller, get rid of the index view, update the edits a little, and switch out the controller class from table to collection. Figure 12-3 shows the results. This collection view displays the same data as the table did, offering selectable cells, edits, and undo/redo support.

Image

Figure 12-3 Recipe 12-4 builds a collection view powered by Core Data.

The refactoring story begins with the data model. Recipe 12-4 adds a new attribute, a binary data item called imageData ...

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.