Easier to use oc's Runtime association API
extension UIView {
public var myColor: UIColor {
set {
self.associationObject["myColor"] = newValue
}
get {
self.associationObject["myColor"]
}
}
}
Using the Swift Package Manager
Add Association as a dependency to your Package.swift
file. For more information, see the Swift Package Manager documentation.
.package(url: "https://github.com/GodL/Association.git", from: "1.0.0")
- Open an issue if you need help, if you found a bug, or if you want to discuss a feature request.
- Open a PR if you want to make some change to
Association
. - Contact @GodL .