Created
April 4, 2013 06:54
-
-
Save demigod19892012/5308386 to your computer and use it in GitHub Desktop.
[IOS]Add swipe back gesture into view
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
// Add Swipe Gesture Recognizer | |
- (void)addSwipeBackGesture | |
{ | |
UISwipeGestureRecognizer *gesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipe:)]; | |
[gesture setDirection:UISwipeGestureRecognizerDirectionRight]; | |
[self.view addGestureRecognizer:gesture]; | |
[gesture release]; | |
} | |
// Handle swipe action | |
- (void)swipe:(id)sender | |
{ | |
//handler your action here | |
//[self back]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment