Swift Macro for allowing variable declarations even in class extensions.
It is implemented by wrapping objc_getAssociatedObject/objc_setAssociatedObject.
Usage
For example, you can add a new stored property to UIViewController by declaring the following
import AssociatedObject
extension UIViewController {
@AssociatedObject(.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
var text = "text"
}
AssociatedObject
Swift Macro for allowing variable declarations even in class extensions. It is implemented by wrapping
objc_getAssociatedObject
/objc_setAssociatedObject
.Usage
For example, you can add a new stored property to
UIViewController
by declaring the followingDeclared properties can be used as follows
License
AssociatedObject is released under the MIT License. See LICENSE