Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save demigod19892012/5308386 to your computer and use it in GitHub Desktop.
Save demigod19892012/5308386 to your computer and use it in GitHub Desktop.
[IOS]Add swipe back gesture into view
// 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