Kulan
Kulan

Reputation: 57

How to save data locally in Realm?

I'm making an app in Swift that will have a Realm database with some preset data in it when the user downloads it from the app store. I know how to make database entries when it's based on user interaction, but I can't figure out the best way to just have the data already there as soon as it's downloaded.

Any advice on this issue will be greatly appreciated,

Thanks in advance!

Upvotes: 0

Views: 742

Answers (1)

segiddins
segiddins

Reputation: 4120

You can bundle a pre-built Realm file with you application that you copy over to the default realm path if there's no file already at that path.

Upvotes: 0

Related Questions