From the course: iOS Development: Architecture

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

App state preservation

App state preservation

From the course: iOS Development: Architecture

Start my 1-month free trial

App state preservation

- [Instructor] In our previous demo, the state restoration delegate method application should restore application state wasn't called. State restoration and preservation requires us to make some preparations. We'll continue with the app launch sample and we're going to add the missing functionality. I went ahead and removed the break points we set previously. First, we need to opt in for state preservation by implementing the application should save application state delegate method. The method should return true to indicate that we want to save the app state. Then, we have to assign restoration identifiers to each view controller that we want to preserve and restore. Let's switch to the story board. We only have a single view controller. I assign the story board ID view controller in the identity inspector. We can reuse it as restoration ID by checking the box 'use story board ID.' To demonstrate the state restoration, we need some content. So I add the text view to our view…

Contents