Here, we’ve created two copies of each variable and assigned ‘nil’ to the second version just to prove the variables were blank between saving and loading. Of course, you won’t be doing this in your actual application.

Initialise Your Data

An easy way to initialise your application settings is to first check if a save file exists with your values. If not, define default values for the application until the user changes this.