CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Sergio Padrino.
SPInteractivePopNavigationController is navigation controller with an interactive transition which tries to mimic the default behavior of iOS 7.
On iOS 7, if you want a custom back button for your navigation controller, you must forget about the nice and out-of-the-box interactive gesture to pop the current view controller. There is a workaround to circumvent this:
self.navigationController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
However, this may lead to some weird behavior of your app, including glitches and random crashes.
Therefore, the only way I found to preserve the original behavior while having custom back buttons is writing your own transition.
Using CocoaPods
Add SPInteractivePopNavigationController to your Podfile:
platform :ios, "7.0"
pod 'SPInteractivePopNavigationController'
Run the following command:
pod install
Manually
Clone the project or add it as a submodule. Drag the whole SPInteractivePopNavigationController folder to your project.
Then, you can simply do:
#import "SPInteractivePopNavigationController.h"
Just use the SPInteractivePopNavigationController (directly or inheriting it) as your navigation controller:
SPMyViewController *myViewController = [[SPMyViewController alloc] init];
SPInteractivePopNavigationController *navigationController = [[SPInteractivePopNavigationController alloc] initWithRootViewController:myViewController];
You don't want to use SPInteractivePopNavigationController in your code? Don't worry, it's still easy: just wire SPPopAnimationController and SPHorizontalSwipeInteractionController with your navigation controller and view controllers. An example of this wiring can be found in the class SPInteractivePopNavigationController.
SPInteractivePopNavigationController was created by Sergio Padrino: @sergiou87, based on VCTransitionsLibrary.
If you want to contribute to the project just follow this steps:
SPInteractivePopNavigationController is available under the MIT license. See the LICENSE file for more info.