Latest 0.3.3
Homepage https://github.com/devxoul/UIViewController-NavigationBar
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit
Authors

Build Status
CocoaPods

UIViewController with its own navigation bar. It provides smooth push animations between view controllers which have different navigation bar styles.

uiviewcontroller navigationbar mov

At a Glance

Override hasCustomNavigationBar method to use custom navigation bar. Then you can use navigationBar property on UIViewController.

class MyViewController: UIViewController {

    override func hasCustomNavigationBar() -> Bool {
        return true // I'm gonna use custom navigation bar!
    }

}

let viewController = MyViewController()
viewController.navigationBar.barTintColor = .purpleColor() // Use custom navigation bar
viewController.navigationItem.title = "Hello" // Change navigationItem property

Note: Don’t confuse with UINavigationController‘s navigationBar.

Hiding System Navigation Bar

With UIViewController+NavigationBar, you have to do something additional to make system navigation bar hidden.

class MyViewController: UIViewController {

    /// Override this method to make built-in navigation bar hidden
    override func prefersNavigationBarHidden() -> Bool {
        return true
    }

}

Installation

I recommend you to use CocoaPods with Podfile:

pod 'UIViewController+NavigationBar'

License

UIViewController+NavigationBar is under MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "UIViewController+NavigationBar",
    "version": "0.3.3",
    "summary": "UIViewController with its own navigation bar.",
    "homepage": "https://github.com/devxoul/UIViewController-NavigationBar",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "devxoul": "[email protected]"
    },
    "source": {
        "git": "https://github.com/devxoul/UIViewController-NavigationBar.git",
        "tag": "0.3.3"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Sources/*.{h,m}",
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This