TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
Floc Reflection is a set of class methods to easily inspect objects in Objective-C.
Car *car = [[Car alloc] init];
BOOL isClass = [FLReflection isClass:car];
BOOL isProtocol = [FLReflection isProtocol:car];
BOOL isBlock = [FLReflection isBlock:car];
BOOL isInstance = [FLReflection isInstance:car];
NSLog(@"isClass = %d", isClass); // NO
NSLog(@"isProtocol = %d", isProtocol); // NO
NSLog(@"isBlock = %d", isBlock); // NO
NSLog(@"isInstance = %d", isInstance); // YES
NSArray *propertyNames = [FLReflection getAllPropertyNamesOfClass:[Car class]];
NSLog(@"propertyNames = %@", propertyNames); // [@"wheel", @"engine"]
// returns class 'Wheel'
id wheelType = [FLReflection getTypeForProperty:@"wheel"
ofClass:[Car class]];
// returns protocol <Engine>
id engineType = [FLReflection getTypeForProperty:@"engine"
ofClass:[Car class]];
You find the source files you need in Floc-Reflection/Classes.
$ cd path/to/project
$ pod install
Open the created Xcode Workspace file.