For the More Curious: State Restoration

We discussed how to work with the state restoration system in Chapter 24, but the Homepwner application did not use storyboards. Let’s take a look at how state restoration works when using storyboards.

Storyboards handle a lot of the boilerplate state restoration code for you. Within a storyboard file, each view controller’s restoration identifier can be set. Typically, the restoration identifier is set to be the same as the storyboard identifier (which you did not need to use in this chapter). For state restoration to work properly, you will want each view controller to have both a storyboard identifier and a restoration identifier (Figure 28.22).

Figure 28.22  Restoration identifier

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.