Persistent storage is data saved to the device, even after the app is closed. This video shows how to save data to and load data from persistent storage on iOS.
- [Instructor] Now we're going to look … at saving and loading our paste board data to … and from persistent storage. … The easiest way to work with persistent storage … in iOS is to use key-value pairs. … That is you have some kind of key … which is a string … and then you associate some kind of value with that. … So we just need a key … and then the value for that key … will be our pastedStrings array. … So let's go up to the top … and I'm going to create a key. … So that'll be above my variable, … so we'll call this DATA_KEY, … so let DATA, and we'll just use all caps, DATA_KEY … and we're going to set that equal to the string data_key. … The reason why it's good to put this in a constant … is because we're going to reference it multiple times … and that way we can use this constant … instead of a literal string to prevent errors. … So go in your code … into viewDidLoad, right above showText, … so between super.viewDidLoad and showText. … And in here we want to see … if we can load some strings, …
- Creating an Xcode project
- Navigating the Xcode interface
- Running your first app
- Building layouts with storyboards
- Connecting UI elements to code
- Coding interactivity