saoudrizwan / Disk

Easily persist structs, images, and data on iOS
MIT License
3.1k stars 170 forks source link

Support for class? #30

Closed fl034 closed 6 years ago

fl034 commented 6 years ago

Is there a reason why in the Readme you're only talking about handling structs, but not classes? In quick tests saving and retrieving codable class instances works fine.

Will there be any changes in class support? I'm asking because I want to use your awesome library for my project but I have some models that are class-based.

saoudrizwan commented 6 years ago

The README uses structs in the examples, but Disk can store any Encodable type and retrieve any Decodable type. I recommend making your persisted types structs since they're value types instead of reference types, ultimately making things easier to work with.