State Preservation in UIKit

Also restoration, if not then what is the point?

Steven Curtis
5 min readMay 12, 2021
Photo by kyryll ushakov on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 11.4.1, and Swift 5.2.2

The state preservation and restoration system is intended to take care of the user interface state. But how can we use this?

Prerequisites:

Terminology

State: The particular condition that the App is in at a specific time

The use-case

We’ve all been there. You’re filling out your details for a shopping expedition on the new yoursupermarket App that you’ve just downloaded — you need more sponges for your “condition” and some vanilla powder for a cake.

Then…you see a squirrel run by. This has to be shared with the world!

--

--

No responses yet