I'm trying to create a text field where the text within becomes a var and a user default which will be displayed all the time.
I have tried making it equal to a variable where I have set it within the section. But I really have no idea what I'm doing.
@State private var Name = UserDefaults.standard.string(forKey: "name")
Section{
TextField("Name", text: $Name)
UserDefaults.standard.set($Name, forKey: "name")
}