Codable
Most iOS applications are, at base, doing the same thing: providing an interface for the user to manipulate data. Every object in an application has a role in this process: Model objects are responsible for holding on to the data that the user manipulates. View objects reflect that data, and controllers are responsible for keeping the views and the model objects in sync.
So saving and loading “data” almost always means saving and loading model objects.
In LootLogger, the model objects that a user manipulates are instances of Item. For LootLogger to be a useful application, instances of Item must persist between runs of the application. In this chapter, you will make the Item type codable so that instances can be saved to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access