Created
October 18, 2013 10:16
-
-
Save abbood/7039483 to your computer and use it in GitHub Desktop.
objective C runtime object associations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIView+Addons.m | |
// Breeze | |
// | |
// Created by Abdullah Bakhach on 5/15/13. | |
// | |
// | |
#import "NSObject+Addons.h" | |
#import <objc/runtime.h> | |
#define kAnimationDuration 0.25f | |
@implementation NSObject (Addons) | |
static char infoKey; | |
-(id)info { | |
return objc_getAssociatedObject(self, &infoKey); | |
} | |
-(void)setInfo:(id)info { | |
objc_setAssociatedObject(self, &infoKey, info, OBJC_ASSOCIATION_RETAIN_NONATOMIC); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment