O'Reilly logo

Swift Programming: The Big Nerd Ranch Guide by John Gallagher, Matthew Mathias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Saving and Loading TodoList

iTahDoodle is now functional. Unfortunately, it forgets the to-do list every time the app is launched. You need to add the ability for TodoList to save and load its state.

Saving TodoList

In Chapter 26, you implemented document saving and loading by taking advantage of features of the NSDocument class. Document-based Mac apps follow patterns (both in the code and the user interface) that have existed for years in OS X and macOS. Most iOS apps, on the other hand, do not operate on documents. iTahDoodle definitely does not – there is a single to-do list, and the user will expect it to stick around.

All iOS applications live inside of an application sandbox. This means that your app cannot see files ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required