Runtime in Objective-C
Using Associated Objects
Associated objects are useful when you want to add functionality to existing classes which requires holding state.
For example, adding a activity indicator to every UIView:
You can also access the Objective-C runtime through Swift:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0