Function

objc_setAssociatedObject(_:_:_:_:)

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

Declaration

func objc_setAssociatedObject(_ object: Any!, _ key: UnsafeRawPointer!, _ value: Any!, _ policy: objc_AssociationPolicy)

Parameters

object

The source object for the association.

key

The key for the association.

value

The value to associate with the key key for object. Pass nil to clear an existing association.

policy

The policy for the association. For possible values, see Associative Object Behaviors.

See Also

Related Symbols

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.