TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by YoungShook.
Tired of the Runtime objc_getAssociatedObject
objc_setAssociatedObject
to the Category implementation method of @Dynamic Property?
Link Blog Post
YSDynamicProperties
is available through CocoaPods, to install it simply add the following line to your Podfile:
pod 'YSDynamicProperties'
#import "NSObject+YSDynamicProperties.h"
to Category file..h
Category file.@dynamic
statement for each property in .m
file.Example:
@interface Superman (YSKit)
@property (strong, nonatomic) UIColor *ys_ShirtColor;
@property (strong, nonatomic) NSArray *ys_Weapons;
@end
#import "NSObject+YSDynamicProperties.h"
@implementation Superman (YSKit)
@dynamic ys_ShirtColor, ys_Weapons;
+ (void)load
{
[self implementDynamicPropertyAccessors];
}
@end