There are several options:
use environment var, in a class that groups all the settings
AppStorage may be a good option. However, if you have a lot of var, that becomes tedious.
How many var have you, of which type ?
An idea here is to multiplex the var.
imagine you have 8 Int var, which value is in fact between 0 and 255.
Then you can create a function to multiplex them:
var1 + 256*var2 * 256*256*var3 etc
and a demux function, using a succession of % and DIV to get each var back
The best would be you show some code so that we can be more specific.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: