Jason Leach
Jason Leach

Reputation: 4229

How do I make a write operation in Realm (iOS) synchronous?

As part of an two step analysis process, I need data to be written to the persistent storage prior to the second step beginning. If I do this asynchronously via fina grain notifications its a bit messy. It would be great two do it in-line in one function.

Is it possible to make a Realm().write { } opperations synchronous? The second step will need to read this data back.

Upvotes: 2

Views: 3171

Answers (1)

bdash
bdash

Reputation: 18308

Realm.write(_:) is synchronous.

Upvotes: 6

Related Questions