github.com/github.com/hryk224/CrossNavigationController

Move to cross using UINavigationController


Keywords
cocoapods, uinavigationcontroller
License
MIT

Documentation

CrossNavigationcontroller

Move to cross using UINavigationController

CocoaPods Compatible Swift 3.0

Requirements

  • iOS 9.0+
  • Swift 3.0+
  • ARC

install

CocoaPods

Adding the following to your Podfile and running pod install:

use_frameworks!
pod "CrossNavigationcontroller"

import

import CrossNavigationcontroller

Usage

  • Change UINavigationController to CrossNavigationcontroller
  • Change UIViewController to CrossViewController
  • If want to use Gesture, set CrossGestureControllable protocol at CrossViewController subclass

Move (push, pop)

func moveViewController(_ viewController: CrossViewController, direction : Cross.Direction, animated: Bool)

Cross.Direction => .up or .down or .left or right

Move to root

// UINavigationController method
func moveToRootViewController(animated: Bool) -> [UIViewController]?

Customize

If change the start coordinates

In CrossNavigationcontroller

override func viewDidLoad() {
  super.viewDidLoad()
  setUp(initialCoordinate: (X, Y))
}

If use custom transition

In CrossNavigationcontroller

override func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
  return CustomTransionAnimator()
}

License

This project is made available under the MIT license. See LICENSE file for details.