/**
* @file AnimateObject.h
* @brief 为NSobject添加customAnimating属性
*/
@property (retain, nonatomic) NSNumber *customAnimating;
@end
* @file AnimateObject.h
* @brief 为NSobject添加customAnimating属性
*/
@interface NSObject(CustomAnimate)
@property (retain, nonatomic) NSNumber *customAnimating;
@end
/**
* @file AnimateObject.m
*/
#import "AnimateObject.h"
#import <objc/runtime.h>
static const void *customAnimatingKey = &customAnimatingKey;
@implementation NSObject(CustomAnimate)
- (NSNumber *)customAnimating {
return objc_getAssociatedObject(self, customAnimatingKey);
}
- (void)setCustomAnimating:(NSNumber *)animating{
objc_setAssociatedObject(self, customAnimatingKey, animating, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
@end