Search Books

Hacking with Swift Project 12 - Saving User Data

Author Paul Hudson
📄 Viewing lite version Full site ›
🌎 Shop on Amazon — choose country
⌛ 🇮🇳 India pricing being fetched… Prices will appear once fetched — usually within a few minutes.
Share:
Book Details
Author(s)Paul Hudson
ISBN / ASINB00S0GDPHG
ISBN-13978B00S0GDPH2
MarketplaceIndia 🇮🇳

Description

Learn how to save user settings and data for later use.

This is our fourth technique project, and we're going to go back to project 10 and fix its glaring bug: all the names and faces you add to the app don't get saved, which makes the app rather pointless!

We're going to fix this using a new class called NSUserDefaults and a new protocol called NSCoding. We'll also be using the class NSKeyedUnarchiver that you just met in project 11, along with its counterpart: NSKeyedArchiver. Putting all these together, we're going to update project 10 so that it saves its people array whenever anything is changed, then loads when the app runs.