JSON to Realm for Offline Data Use

I’m working on a proof-of-concept for a new SwiftUI app using Realm Cocoa.

Right now I am pulling JSON from a public API, but I would like to write those objects to Realm so that the information could be available offline.

The API does have a “give me only the objects that have been added/updated since ______” type of request, so I think it would also be super beneficial for not pulling down the entire set of objects and then running comparisons.

Is this something that is typically done in a local Realm or are there any best practices for this or am I all on my own out in left field on this one?

Thanks.

–Kurt

Your proposal sounds reasonable - are you having difficulty with some code?

How the process is “typically done” will vary greatly depending on the use case so I don’t think the question is directly answerable.

I suggest writing some code and give it a try - Realm is well-suited for offline (and online) work.