You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think adding this extra step is necessary for the sake of simplicity when using Disk for most use cases.
In your case, where you want to change some of the JSONEncoder's properties, like it's date coding strategy, I suggest you convert your Codable struct to Data first using your own JSONEncoder and then using Disk to save that data, Disk.save(data, to: .documents, as: "messages.json")
nixzhu's PR allows users to pass a custom decoder/encoder or use the default one. So merging it shouldn't cause any issue to existing code. It would be great if it could be merged, it would keep things nice and simple, rather than converting into a Data object back and forth.
I think we need to pass encoder & decoder if necessary.
A pull request is here #16
The text was updated successfully, but these errors were encountered: