msn

MSNavigationSwipeController

Subclass of UINavigationController to add 'swipe right to go back' gesture recognizer like most apps (Facebook, Tweetbot) already do.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

74

Maintenance

Last Commit

8yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Categories

Readme

MSNavigationSwipeController

Subclass of UINavigationController to add swipe right to go back gesture recognizer like most apps (Facebook, Tweetbot) already do.

Just a couple of lines of code that are gonna improve the user experience of every app (especially for iPhone 5 users!).

Get it ready

Add it with CocoaPods

pod 'MSNavigationSwipeController'

and use MSNavigationSwipeController as your navigation controller.

How it works

- (void)addSwipeGestureRecognizer
{
  UISwipeGestureRecognizer *swipeGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRecognized:)];
  [self.view addGestureRecognizer:swipeGestureRecognizer];
}

- (void)swipeRecognized:(UISwipeGestureRecognizer *)gestureRecognizer
{
  if (gestureRecognizer.state == UIGestureRecognizerStateEnded &&
    gestureRecognizer.direction & UISwipeGestureRecognizerDirectionRight) {
    [self popViewControllerAnimated:YES];
  }
}

That's it, really!

You can also temporarily disable it with the property canSwipeRightToGoBack.

Credits

Freely inspired by Facebook, Tweetbot and many other apps.

Contact

Marco Sero

License

MSNavigationSwipeController is available under the MIT license. See the LICENSE file for more info.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100