literator / MOPropertyAnalyzer

Small project allowing to get all necessary information about properties easily and quickly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Property Analyzer

It's a small project that allow to get all necessary information about properties of given class. Easy and simple tool ready to use. Just copy MOPropertyAnalyzer folder to destination project.

Example

MOPropertyAnalyzer *propertyAnalyzer = [MOPropertyAnalyzer analyzerWithClass:[MyObject class]];
MOPropertyDescriptor *descriptor = [propertyAnalyzer descriptorForPropertyName:@"complexRatio"];

NSAssert(descriptor.isPrimitive, @"It should be primitive type.");
NSAssert(descriptor.isReadonly, @"It should be readonly type.");
...

NSArray *propertyDescriptors = propertyAnalyzer.propertyDescriptors;
for (MOPropertyDescriptor *descriptor in propertyDescriptors) {
    NSLog(@"Property class name = %@", descriptor.className ?: @"No class name");
}

TODO

  • Get struct, union details

Feedback

If you have some good thoughts, you want to contribute or give me an advice, please do. Contact me, create an issue or PR.

License

MIT

About

Small project allowing to get all necessary information about properties easily and quickly


Languages

Language:Objective-C 100.0%