This file contains hidden or 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 <objc/runtime.h> | |
void PrintClassHierarchy(Class cls) { | |
printf("// Class Hierarchy of %s\n", class_getName(cls)); | |
Class superClass = cls; | |
while (superClass) { | |
printf("%s", class_getName(superClass)); | |
superClass = class_getSuperclass(superClass); | |
if (superClass) { | |
printf(" : "); |
This file contains hidden or 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
@interface UIGestureRecognizerTarget : NSObject { | |
id _target; | |
SEL _action; | |
} | |
- (NSString *)description; | |
@end |
This file contains hidden or 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 <objc/runtime.h> | |
void LogGesture(UIGestureRecognizer *gestureRecognizer) { | |
id object = [[gestureRecognizer valueForKey:@"targets"] firstObject]; | |
id target = [object valueForKey:@"target"]; | |
Ivar ivar = class_getInstanceVariable([object class], "_action"); | |
SEL action = (__bridge void *)object_getIvar(object, ivar); | |
NSMutableString *mString = [NSMutableString stringWithFormat:@"%@; action=%@; target=%@;", | |
NSStringFromClass(gestureRecognizer.class), | |
NSStringFromSelector(action), |
This file contains hidden or 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 "ViewController.h" | |
#import <objc/runtime.h> | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
Class cls = self.class; | |
Method m1 = class_getInstanceMethod(cls, @selector(methodA)); |
This file contains hidden or 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 "ViewController.h" | |
#import <objc/runtime.h> | |
static NSMutableDictionary *_stack; | |
NSString *LogGesture(UIGestureRecognizer *gestureRecognizer); | |
@interface UIView (LogGesture) | |
- (void)exchangedAddGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer; | |
@end |
This file contains hidden or 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
// MPMusicPlayerController has private method setVolume: and setVolumePrivate: | |
// The following KVO works on iOS 8.3. | |
MPMusicPlayerController *playerController = [MPMusicPlayerController systemMusicPlayer]; | |
[playerController setValue:@(0.1) forKey:@"volume"]; | |
[playerController setValue:@(0.2) forKey:@"volumePrivate"]; |
This file contains hidden or 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
- (NSString *)test | |
{ | |
NSString *string = @"whitespace is invisible"; | |
return string; | |
} |
This file contains hidden or 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
.gist { | |
color: #333; | |
font-size: 16px; | |
} | |
.gist .markdown-body { | |
overflow: hidden; | |
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; | |
font-size: 16px; | |
line-height: 1.6; | |
word-wrap: break-word; |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Colors</key> | |
<dict> | |
<key>Background</key> | |
<string>1.000 1.000 1.000</string> | |
<key>InsertionPoint</key> | |
<string>0.000 0.000 0.000</string> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0 0 0 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>Menlo-Bold - 11.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>0 0 0 1</string> |