As I cannot create a synthesized property in a Category in Objective-C, I do not know how to optimize the following code:
@interface MyClass (Variant) @prope
Just use libextobjc library:
h-file:
@interface MyClass (Variant) @property (nonatomic, strong) NSString *test; @end
m-file:
#import @implementation MyClass (Variant) @synthesizeAssociation (MyClass, test); @end
More about @synthesizeAssociation