Type Method


Associates an arbitrary object with the current transaction using the specified key.


class func setValue(_ value: Any?, forKey key: String)



An object to associate with the current transaction.


A unique string identifying the object for later retrieval.


Nested transactions have nested data scope. Setting a value for a key associates it with the current transaction (or innermost nested transaction) only, and reading the value for a key searches through nested transactions (starting from the innermost).

See Also

Getting and Setting Transaction Properties

class func value(forKey: String) -> Any?

Returns the object previously associated with the current transaction using the specified key.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software