Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyClass {
- }
- private var key: Void?
- extention MyClass {
- var title: String? {
- get {
- return objc_getAssociatedObject(self, &key) as? String
- }
- set {
- objc_setAssociatedObject(self, &key, newValue, .OBJC_ASSOCIATED_RETAIN_NONATOMIC)
- }
- }
- }
Add Comment
Please, Sign In to add comment