Created
March 24, 2014 14:35
-
-
Save langford/9741280 to your computer and use it in GitHub Desktop.
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
@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