SCNavigationController is an UINavigationController like container view controller and was built to provide and expose more features and control. It is especially helpful in customizing the push/pop animations through layouters and custom timing functions, and to know when those animations are finished through completion blocks.
It was built on top of the SCStackViewController and for that reason it supports and builds on top of the following features:
-
Supports customizable transitions and animations through custom layouters, easing functions and animation durations (examples bellow)
-
Offers completion blocks for all stack related operations
-
Allows stacking view controllers on the top, left, bottom or right side of the root view controller
-
Exposes an interactiveGestureRecognizer not just for popping but for full stack navigation and allows changes on this gesture's trigger area
and more..
- Import the navigation controller into your project
#import "SCNavigationController.h"
- Create a new instance
navigationController = [[SCNavigationController alloc] initWithRootViewController:rootViewController];
- Register layouters (optional, defaults to SCParallaxStackLayouter)
id<SCStackLayouterProtocol> layouter = [[SCParallaxStackLayouter alloc] init];
[navigationController setLayouter:layouter];
- Push view controllers
[self.navigationController pushViewController:viewController animated:YES completion:nil];
- Pop view controllers
[self.navigationController popViewControllerAnimated:YES completion:nil];
- Pop to any given view controller
[self.navigationController popToViewController:viewController animated:YES completion:nil];
- Pop to the root view controller
[self.navigationController popToRootViewControllerAnimated:YES completion:nil];
######Check out the demo project for more details (pod try)
SCNavigationController is released under the MIT License (MIT) (see the LICENSE file)
Any suggestions or improvements are more than welcome. Feel free to contact me at [email protected] or @stefanceriu.