Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
devxoul committed Aug 26, 2014
1 parent 90b2566 commit bdbfb1c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
52 changes: 47 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,52 @@
SwipeBack
=========
# SwipeBack

Re-enable iOS7 swipe-to-back with custom back button.


Just import it.
---------------
## Background

`#import <SwipeBack/SwipeBack.h>`
1. With setting custom back button via `leftBarButtonItem`, default swipe-to-back gesture is disabled.
2. Assigning `interactivePopGestureRecognizer` as `UINavigationController` (a common solution) can cause unexpected errors:

> - nested pop animation can result in corrupted navigation bar
> - Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
3. Put custom code everywhere around `UINavigationController` is too annoying.


## The Answer is SwipeBack

1. **Not annoying**
You don't need to code.

2. **iOS7 native behavior**
Not a foolishly-customized gesture recognizer.

3. **Safe**
No error anymore.


## Use SwipeBack

### CocoaPods

Just add a line below into your `Podfile`. You don't need to write any code. CocoaPods automatically import SwipeBack globally.

```
pod 'SwipeBack'
```

### Without CocoaPods (Why not use?)

Import SwipeBack at your `.pch` file.

```
#import "SwipeBack.h"
```

It's done.


## How does it work

See [`UINavigationController+SwipeBack.m`](https://github.com/devxoul/SwipeBack/blob/master/SwipeBack/UINavigationController%2BSwipeBack.m) and [`UIViewController+SwipeBack.m`](https://github.com/devxoul/SwipeBack/blob/master/SwipeBack/UIViewController%2BSwipeBack.m). Want to know more about method swizzling, visit [here](http://nshipster.com/method-swizzling/).
2 changes: 1 addition & 1 deletion SwipeBack.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SwipeBack"
s.version = "0.1.0"
s.version = "1.0.0"
s.summary = "SwipeBack"
s.homepage = "http://github.com/devxoul/SwipeBack"
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down

0 comments on commit bdbfb1c

Please sign in to comment.