Skip to content

Commit 4d193b2

Browse files
committed
Merge pull request #91 from neilpa/label-missing-keys
Keys for UILabel associations
2 parents 69c63ef + ade2e0d commit 4d193b2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Source/UIKit/UILabel.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ extension UILabel {
1717

1818
/// Wraps a label's `attributedText` value in a bindable property.
1919
public var rex_attributedText: MutableProperty<NSAttributedString?> {
20-
return associatedProperty(self, key: &attributedText, initial: { $0.attributedText }, setter: { $0.attributedText = $1 })
20+
return associatedProperty(self, key: &attributedTextKey, initial: { $0.attributedText }, setter: { $0.attributedText = $1 })
2121
}
2222

2323
/// Wraps a label's `textColor` value in a bindable property.
2424
public var rex_textColor: MutableProperty<UIColor> {
25-
return associatedProperty(self, key: &textColor, initial: { $0.textColor }, setter: { $0.textColor = $1 })
25+
return associatedProperty(self, key: &textColorKey, initial: { $0.textColor }, setter: { $0.textColor = $1 })
2626
}
2727
}
28+
29+
private var attributedTextKey: UInt8 = 0
30+
private var textColorKey: UInt8 = 0

0 commit comments

Comments
 (0)