I have a custom structure called Place with a few variables such as "Name: String!" and "Description: String!" in there.
I then create a very long dictionary [Int : Place] called PlacesDict in my code with hard-coded values for the keys and values, meaning I enter in all the values in the Place structures in that dictionary.
Then, when I run my app, I have a button. When the button is pressed, it runs the following line of code
UserDefaults.standard.set(placesDict, forKey: "places")
I then get an error in the console that says "
[User Defaults] Attempt to set a non-property-list object { [It prints a portion of my very long dicitonary here] }
libc++abi.dylib: terminating with uncaught exception of type NSException
"
What is going on here and how can I fix it?