I may be overlooking something in the Sync Data getting started guide but it says
Therefore, it’s a best practice never to write on the main thread when using Realm Sync.
but then the example code writes data on the main thread.
// Write to the realm. No special syntax required for synced realms.
try! realm.write {
realm.add(Task(partition: partitionValue, name: "My task"))
}
and indicates there’s no special syntax required even though it’s not supposed to be done that way.
Is there clarification on that and perhaps some best practice code?
Also, previously with realm when writing large amounts of data the write would be wrapped in an autorelease pool - is that still the case?