Created
January 16, 2016 14:55
-
-
Save leoschweizer/f6fc9fe822473b9de0af to your computer and use it in GitHub Desktop.
Finding the class with the most instance variables in your Objective-C runtime environment with Heliograph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <OpinionatedC/OpinionatedC.h> | |
#import <Heliograph/Heliograph.h> | |
NSArray *classes = [HGClassMirror allClasses]; | |
HGClassMirror *mostInstanceVariables = [classes max:^NSNumber *(HGClassMirror *each) { | |
return @([[each instanceVariables] count]); | |
}]; | |
NSLog(@"%@ has %lu instance Variables", mostInstanceVariables, (unsigned long)[[mostInstanceVariables instanceVariables] count]); | |
// => <HGClassMirror on UIKeyboardImpl> has 125 instance Variables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment