Skip to content

Commit bdbfb1c

Browse files
committed
Update README.
1 parent 90b2566 commit bdbfb1c

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

README.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,52 @@
1-
SwipeBack
2-
=========
1+
# SwipeBack
32

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

65

7-
Just import it.
8-
---------------
6+
## Background
97

10-
`#import <SwipeBack/SwipeBack.h>`
8+
1. With setting custom back button via `leftBarButtonItem`, default swipe-to-back gesture is disabled.
9+
2. Assigning `interactivePopGestureRecognizer` as `UINavigationController` (a common solution) can cause unexpected errors:
10+
11+
> - nested pop animation can result in corrupted navigation bar
12+
> - Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
13+
14+
3. Put custom code everywhere around `UINavigationController` is too annoying.
15+
16+
17+
## The Answer is SwipeBack
18+
19+
1. **Not annoying**
20+
You don't need to code.
21+
22+
2. **iOS7 native behavior**
23+
Not a foolishly-customized gesture recognizer.
24+
25+
3. **Safe**
26+
No error anymore.
27+
28+
29+
## Use SwipeBack
30+
31+
### CocoaPods
32+
33+
Just add a line below into your `Podfile`. You don't need to write any code. CocoaPods automatically import SwipeBack globally.
34+
35+
```
36+
pod 'SwipeBack'
37+
```
38+
39+
### Without CocoaPods (Why not use?)
40+
41+
Import SwipeBack at your `.pch` file.
42+
43+
```
44+
#import "SwipeBack.h"
45+
```
46+
47+
It's done.
48+
49+
50+
## How does it work
51+
52+
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/).

SwipeBack.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "SwipeBack"
3-
s.version = "0.1.0"
3+
s.version = "1.0.0"
44
s.summary = "SwipeBack"
55
s.homepage = "http://github.com/devxoul/SwipeBack"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

0 commit comments

Comments
 (0)