Settings View Controller Tips & Suggestions

I am thinking about creating a view controller that will be used primarily for settings and app configurations. I know that one can segue view controllers programmatically and transfer data between view controllers but, would that really be efficient? My thought for the settings VC would be theming and app bit (integer) settings.

Does anyone have any tips and or suggestions for an efficient way to apply user based settings from one View Controller that controls user settings?
Answered by Claude31 in 643097022

would that really be efficient

What type of efficiency do you think of ?
  • devices resources ? That's not an issue, unless you have tens of thousands of settings (which would be another design issue)

  • user experience : but the way data are stored is not visible to the user

So, what is the problem you want to solve ?

You have 3 ways at least of sharing data :
  • transfer data through segue

  • create a singleton class that holds all the settings (and save them of course in user settings, or in file…). In SwiftUI, that is environment var.

  • read locally from storage in each view where you need (create a common class of utilities to do it).

I personally prefer the second option when there are more of a few var to pass.
Accepted Answer

would that really be efficient

What type of efficiency do you think of ?
  • devices resources ? That's not an issue, unless you have tens of thousands of settings (which would be another design issue)

  • user experience : but the way data are stored is not visible to the user

So, what is the problem you want to solve ?

You have 3 ways at least of sharing data :
  • transfer data through segue

  • create a singleton class that holds all the settings (and save them of course in user settings, or in file…). In SwiftUI, that is environment var.

  • read locally from storage in each view where you need (create a common class of utilities to do it).

I personally prefer the second option when there are more of a few var to pass.
Settings View Controller Tips & Suggestions
 
 
Q