Chapter 5: Building a Structure for ToDo Items
iOS apps are often developed using a design pattern called Model-View-Controller (MVC). In this pattern, each class, struct, or enum is either a model object, view, or controller. Model objects are responsible for storing data. They should be independent of the kind of presentation provided by the UI. For example, it should be possible to use the same model object for an iOS app and a command-line tool on macOS.
View objects present the data. They are responsible for making the objects visible (or hearable, in the case of a VoiceOver-enabled app) for the user. Views are special for the device that the app is executed on. In the case of a cross-platform app, view objects cannot be shared. Each platform needs an implementation of a view layer.
Controller objects communicate between the model and view objects. They are responsible for making the model objects presentable.
We will use MVC for our to-do app because it is one of the...