Move to cross using UINavigationController
- iOS 9.0+
- Swift 3.0+
- ARC
Adding the following to your Podfile
and running pod install
:
use_frameworks!
pod "CrossNavigationcontroller"
import CrossNavigationcontroller
- Change
UINavigationController
toCrossNavigationcontroller
- Change
UIViewController
toCrossViewController
- If want to use Gesture, set
CrossGestureControllable
protocol at CrossViewController subclass
func moveViewController(_ viewController: CrossViewController, direction : Cross.Direction, animated: Bool)
Cross.Direction
=> .up
or .down
or .left
or right
// UINavigationController method
func moveToRootViewController(animated: Bool) -> [UIViewController]?
In CrossNavigationcontroller
override func viewDidLoad() {
super.viewDidLoad()
setUp(initialCoordinate: (X, Y))
}
In CrossNavigationcontroller
override func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return CustomTransionAnimator()
}
This project is made available under the MIT license. See LICENSE file for details.