Function

objc_getAssociatedObject(_:_:)

Returns the value associated with a given object for a given key.

Declaration

func objc_getAssociatedObject(_ object: Any, _ key: UnsafeRawPointer) -> Any?

Parameters

object

The source object for the association.

key

The key for the association.

Return Value

The value associated with the key key for object.

See Also

Associative References

func objc_setAssociatedObject(Any, UnsafeRawPointer, Any?, objc_AssociationPolicy)

Sets an associated value for a given object using a given key and association policy.

func objc_removeAssociatedObjects(Any)

Removes all associations for a given object.