3 ms·
keychain persists, user defaults won't, if you store files in the documents directory it will persist if offloading the application. CoreData will NOT afaik, un
by ericlewis 5y ago
keychain persists, user defaults won't, if you store files in the documents directory it will persist if offloading the application. CoreData will NOT afaik, unless you choose to define where it persists. I'd also say that CoreData isn't exactly only meant for persisting data either - it can do that, but first and foremost it is an object graph.
more fun facts: user defaults has a limit to how big it can be. And I also think that your library would benefit from using actual types instead of Any, you can actually define this so long as the value is Codable, generics would make the library nicer to work with instead of requiring the dev to cast the type themselves. You basically just switch out Any for a generic and have the Generic conform to Codable. If targeting an iOS version that is 14+ I would just recommend using the AppStorage or SceneStorage property wrappers.
- ChrisMarshallNY 5y agoHey, thanks for that! I can probably require Codable (even though it has been around for a while, I've only been using Codable a few months). I'll probably do that. I started it years ago, so it has a lot of legacy. I will probably do a refactor, when I come up for air. A couple of my libs could use a facelift.