withTransaction(_:_:)
Executes a closure with the specified transaction and returns the result.
Declaration
func withTransaction<Result>(_ transaction: Transaction, _ body: () throws -> Result) rethrows -> ResultParameters
- transaction:
An instance of a transaction, set as the thread’s current transaction.
- body:
A closure to execute.
Return Value
The result of executing the closure with the specified transaction.