Modeling a To-Do List

Recall from Chapter 26 that iOS and Mac applications usually follow a Model-View-Controller architecture. You have already created a view (your storyboard and UI elements) and a controller (your ViewController class). At this point, however, you do not have a model. Create a Cocoa Touch class by selecting FileNewFile.... Select Source under iOS, then select Cocoa Touch Class (Figure 27.17).

Figure 27.17  Creating a new Cocoa Touch class

Creating a new Cocoa Touch class

On the next screen, name your class TodoList, make it a subclass of NSObject, and make sure the language is set to Swift (Figure 27.18).

Figure 27.18  Creating ...

Get Swift Programming: The Big Nerd Ranch Guide 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.