Modify the underlying Realm file while blocking the calling thread until the transaction is done. Write transactions automatically commit any changes made when the closure returns unless MutableRealm.cancelWrite was called.
The write transaction always represent the latest version of data in the Realm file, even if the calling realm not yet represent this.
any value returned from the provided write block.
function that should be run within the context of a write transaction.