FTGPropertyMaestro 1.0

FTGPropertyMaestro 1.0

LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Khoa Pham.

Synthesize properties for categories

How I do it

  • Swizzle getter and setter
  • Using associated object

How to use it

  • Import FTGPropertyMaestro and you're good to go
  • Property with backing instance variable or not of object type are not supported
@property (nonatomic, assign) BOOL categoryBoolProperty;

This property is not supported because it is of type BOOL

@interface FTGClassA : NSObject

@property (nonatomic, strong) NSNumber *strongProperty;


This property is not supported because it is not in category, it will be auto synthesized to have getter, setter and backing instance variable.

  • Support custom getter and setter
@property (nonatomic, copy, setter = updateCategoryCopyProperty:) NSString *categoryCopyProperty;
  • Set association type depends on your property attribute
@property (nonatomic, strong) NSNumber *categoryStrongProperty;


  • Remember to use @dynamic to suppress warning
  • FTGPropertyMaestro will synthesize getter and setter for you, using associated object (Replace implementation if they exist, or add new implementation if they do not exist)

Property Retrieval

NSArray *kClassAProperties = [FTGPropertyMaestro propertiesForClass:[FTGClassA class]];
FTGProperty *wheelNumberProperty = [FTGPropertyMaestro propertyForClass:[FTGCar class]

Synthesize property for category


@interface FTGClassA (FTGAdditions)

@property (nonatomic, assign, getter = fetchCategoryBoolProperty) BOOL categoryBoolProperty; @property (nonatomic, strong) NSNumber *categoryStrongProperty; @property (nonatomic, copy, setter = updateCategoryCopyProperty:) NSString *categoryCopyProperty;



@implementation FTGClassA (FTGAdditions)

@dynamic categoryBoolProperty; @dynamic categoryCopyProperty; @dynamic categoryStrongProperty;

  • (void)load { [FTGPropertyMaestro synthesizeClass:self propertyNames:@[ @"categoryCopyProperty", @"categoryStrongProperty"] ]; }


Use XCTest

This project is released under the MIT license. See LICENSE.md