Skip to content

Instantly share code, notes, and snippets.

@langford
Created March 24, 2014 14:35
Show Gist options
  • Save langford/9741280 to your computer and use it in GitHub Desktop.
Save langford/9741280 to your computer and use it in GitHub Desktop.
@implementation SwiperViewController
- (void)viewDidLoad {
[super viewDidLoad];
UIScreenEdgePanGestureRecognizer *edgePanLeft = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleEdgePanLeft:)];
edgePanLeft.edges = UIRectEdgeLeft;
[self.view addGestureRecognizer:edgePanLeft];
UIScreenEdgePanGestureRecognizer *edgePanRight = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleEdgePanRight:)];
edgePanRight.edges = UIRectEdgeRight;
[self.view addGestureRecognizer:edgePanRight];
UIView* view = self.view;
while (view){
NSLog(@"Gesture Recognizers %@",view.gestureRecognizers);
view = view.superview;
}
}
- (void)handleEdgePanLeft:(UIScreenEdgePanGestureRecognizer *)edgePan {
NSLog(@"left");
}
- (void)handleEdgePanRight:(UIScreenEdgePanGestureRecognizer *)edgePan {
NSLog(@"right");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment