Well there's all sorts of ways to save data but this sounds specifically like a job for the user preferences. So you want to look into the Standard User Defaults. Declared like so ...
let defaults:UserDefaults = UserDefaults.standard
You would want to declare this in any of your Swift files that save or read from the defaults.
So in your main code, you can save to the defaults like so...
self.defaults.set( "red" , forKey: "BackgroundColor")
Perhaps someone clicks a red button, so the defaults now has a key named BackgroundColor equaling "red"
Then access them from anywhere else like so...
let theColor:String = defaults.object(forKey: "BackgroundColor")
And depending on what kind of value you are saving that line might vary. For example...
let someNumber:Int = defaults.integer(forKey: "BackgroundColor")
The beauty of the Standard User Defaults is that as long as the user doesn't delete the app, this data persists. So months later they might come back to the app, and if they changed the background color previously, you can code the app to search for a previously saved default key, and if one exists, adjust the color accordingly. So you'll do things like this when the app launches...
if ( defaults.object( forKey: "BackgroundColor") != nil) {
// do something with the object for the key because one exists
}
Just remember once you start saving to the defaults, you'll need to reset the Simulator (or delete the app from the Simulator) or delete the app from your test device to clear out those defaults.