Skip to content

Instantly share code, notes, and snippets.

@kylehowells
Created August 6, 2014 03:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylehowells/9aeb36ea211f65c823d7 to your computer and use it in GitHub Desktop.
Save kylehowells/9aeb36ea211f65c823d7 to your computer and use it in GitHub Desktop.
My best understanding of how SpringBoard manages its SBGestureRecognizers
//SpringBoard
-(void)_reloadDemoAndDebuggingDefaultsAndCapabilities{
//..Blah blah, setting stuff up, etc.., etc...
// Control Centre gesture
SBOffscreenSwipeGestureRecognizer *gesture = [[SBOffscreenSwipeGestureRecognizer alloc] initForOffscreenEdge:0x4];
[gesture setTypes:0x40];
[gesture setShouldUseUIKitHeuristics:YES];
[gesture setMinTouches:1];
/*
r14 = *_NSConcreteStackBlock;
var_m768 = r14;
var_m760 = 0xc2000000;
var_m756 = 0x0;
var_m752 = sub_1001474eb;
var_m744 = 0x1003d78b0;
var_m736 = r12;
var_m728 = r15;*/
[gesture setHandler:^(){ /* I don't know what goes here! I think it returns void and maybe takes 1(2?) parameteres */ }];
/*
var_m816 = r14;
var_m808 = 0xc2000000;
var_m804 = 0x0;
var_m800 = sub_10014757b;
var_m792 = 0x1003d78e0;
var_m784 = r12;
var_m776 = r15;
*/
[gesture setCanBeginCondition:^(){ /* I think this one returns BOOL and takes... 1(2?) parameters */ }];
add_GestureRecognizer(gesture);
// more stuff under here...
}
static NSMutableArray *sbGestureRecognizers = nil;
function add_GestureRecognizer(SBGestureRecognizer *gesture) {
static dispatch_once_t onceToken = 0;
dispatch_once(&onceToken, ^{
sbGestureRecognizers = [[NSMutableArray alloc] init];
});
[sbGestureRecognizers addObject:gesture];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment