TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Mar 2019 |
SPMSupports SPM | ✗ |
Maintained by Brad Hilton, Brad Hilton.
Depends on: | |
AssociatedValues | ~> 5.0.0 |
OrderedObjectSet | ~> 5.0.0 |
AssociatedValues
allows you to easily add stored properties in class extensions:
extension UIView {
var identifier: String {
get {
return getAssociatedValueForProperty("identifier", ofObject: self, withInitialValue: "Unknown")
}
set {
setAssociatedValue(newValue, forProperty: "identifier", ofObject: self)
}
}
}
Enjoy!
AssociatedValues
is available through CocoaPods. To install, simply include the following lines in your podfile:
use_frameworks!
pod 'AssociatedValues'
Be sure to import the module at the top of your .swift files:
import AssociatedValues
Alternatively, clone this repo or download it as a zip and include the classes in your project.
Brad Hilton, [email protected]
AssociatedValues
is available under the MIT license. See the LICENSE file for more info.