         let index = self.navigationController?.viewControllers.count ?? 1
         let configuration = configurations[index % configurations.count]
 
-        let viewController = ViewController()
-        viewController.hasNavigationBar = true
+        let viewController = BarViewController()
         viewController.navigationItem.title = "ViewController \(index)"
         if configuration.hasNavigationBackground {
             viewController.navigationBar.setBackgroundImage(nil, forBarMetrics: .Default)

import UIKit
import UIViewController_NavigationBar

final class ViewController: UIViewController {

    let button = UIButton(type: .System)


        return UIColor(red: red, green: green, blue: blue, alpha: 1)
    }

    override func prefersNavigationBarHidden() -> Bool {
        return true
    }

}

class BarViewController: ViewController {

    override func hasCustomNavigationBar() -> Bool {
        return true
    }

}
