The need is to persist between launches the state of storyboard objects such as of type UISwitch, UITextField, etc. Can this be done using @AppStorage? If so how can @AppStorage be set to watch these?
I tried getting @AppStorage to watch an outlet class member variable that is connected to the storyboard object:
@IBOutlet weak var iPhoneName: UITextField!
@AppStorage("iPhoneName") var iPhoneName: String = ""
This got an error because the variable to be watched is already declared.
I decided to make the the watched variable different than the one connected to the Storyboard's UITextField object:
@AppStorage("iPhoneName") var striPhoneName: String = ""
and got the error: Unknown attribute 'AppStorage' . In what import library is @AppStorage defined?
If @AppStorage cannot be used for this, what is the easiest way to code storyboard object persistence? I am looking for an easy, and quick way. I am not concerned with memory usage right now.