I have a fatal error when trying to set the device string as a key, print out is fine so I'm guessing I'm trying to store it as the wrong type(trying to store as a String) I've tried the Class of device and UIDevice.Device, but I thought I should just ask after some failed attempts?
The error: "Attempt to insert non-property list object Simulator (iPhone SE (3rd generation)) for key userDevice"
the key:@AppStorage("userDevice") var userDevice: String = ""
UserDefaults.standard.set(Device.current, forKey: "userDevice")
print("--------------(userDevice)-----------")
(I want to save the users device info, and refrence it when loading the view to limit features depending on hardware capabilities. I'm a student so sorry in advance if this is a stupid issue to raise)
I have a fatal error when trying to set the device string as a key, print out is fine so I'm guessing I'm trying to store it as the wrong type(trying to store as a String) I've tried the Class of device and UIDevice.Device, but I thought I should just ask after some failed attempts?
The error: "Attempt to insert non-property list object Simulator (iPhone SE (3rd generation)) for key userDevice" the key:@AppStorage("userDevice") var userDevice: String = "" UserDefaults.standard.set(Device.current, forKey: "userDevice") print("--------------(userDevice)-----------")
(I want to save the users device info, and refrence it when loading the view to limit features depending on hardware capabilities. I'm a student so sorry in advance if this is a stupid issue to raise)