Latest 0.2.0
License MIT
Platforms ios 9.0, requires ARC

CI Status

The KYFlipNavigationController is an custom NavigationController the use UIViewController to manager the UIViewController(include UINavigationController,UITabbarController,UIViewController) like the UINavigationController .
Many app like EasyNet News and Toutiao use TabbarController UINavigationController when push


alt tag


To run the example project, clone the repo, and run pod install from the Example directory first.


Set up flipNavigationController as root of a window,self.flipNavigationController will find the KYFlipNavigationController if it’s exist!

   let firstVC = FirstViewController(nibName: nil, bundle: nil);
   firstVC.title = "First"
   let firstNavi = UINavigationController(rootViewController: firstVC)

   let sencondVC = SecondViewController(nibName: nil, bundle: nil);
   sencondVC.title = "Second"

   let tabbar = RDVTabBarController()
   tabbar.viewControllers = [firstNavi,sencondVC]
   let flipViewController = KYFlipNavigationController(rootViewCotroller: tabbar)
   self.window = UIWindow();
   self.window?.backgroundColor = UIColor.white;
   self.window?.rootViewController = flipViewController;

Push or Pop

Push and pop almost like the UINavigationController . The key way is to find the flipNavigationController. It’s easy that we use a UIViewController’s extension

   let  viewController = ThirdViewController(nibName: nil, bundle: nil)
   viewController.title = "cell_(indexPath.row)"
   // push a navigationcontroller
   let navi = UINavigationController(rootViewController: viewController)
   self.rdv_tabBarController.flipNavigationController?.pushViewController(navi, animated: true)//self is add to a tabbarcontroller

   //we also an push a UIViewController,and if self is not add to a tabbarcontroller
   self.flipNavigationController?.pushViewController(viewController, animated: true)

    //also we can pop to a viewcontroller or to the rootviewcontroller

The public func

   pushViewController(_ viewController : UIViewController, animated : Bool, completed : KYFlipNavigationCompletionBlock? = nil)

   public func popViewController(_ animated : Bool, completed : KYFlipNavigationCompletionBlock? = nil)
   public func popToViewController(_ viewController : UIViewController, animated : Bool, completed : KYFlipNavigationCompletionBlock? = nil)
   public func popToRootViewControllerAnimated(_ animated : Bool ,completed : KYFlipNavigationCompletionBlock?)

Change the stack

You can also change the UIViewController stack when you want,so you can remove some viewcontroller or add some viewcontroller from the stack and change the pop way

    guard let viewControllers = self.flipNavigationController?.viewControllers else {
    var newControllers : Array<UIViewController> = []
    for viewController in viewControllers {
       if !viewController.isKindOfClass(ForthViewController.self) {
    self.flipNavigationController?.viewControllers = newControllers



KYFlipNavigationController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "KYFlipNavigationController"


kyleYang, [email protected]

If you find any porblem , please tell me


KYFlipNavigationController is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "KYFlipNavigationController",
    "version": "0.2.0",
    "summary": "A Custom NavigationController that use UIViewController to manager the UIViewCotroller which can use for push and pop",
    "description": "This Custome NavigationContoller can easy be used in UITabBarController and UINavigationController, You can push a UINavigationController or UITabBarController in a UINavigationController like EasyNet News app.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "kyleYang": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.2.0"
    "platforms": {
        "ios": "9.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "pushed_with_swift_version": "3.1"

Pin It on Pinterest

Share This