I want to save a struct which can not be modified to UserDefaults
in my code. I went through a number of solutions but everyone is advising to use Codable/NSCoding
in the struct. I can not edit the struct. Does anyone have an idea how we can achieve this.
I tried to wrap the object to an NSDictionary
but while trying to save, it crashes saying 'Attempt to insert non-property list object'. Is it because I have nil values in my model?
Any help is appreciated.