Latest 0.1.2
Homepage https://github.com/Ginxx/EachNavigationBar
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Example

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

Requirements

Installation

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

pod 'EachNavigationBar'

Overview

Usage

Import

import EachNavigationBar

Setup

// before window set root view controller
UIViewController.setupNavigationBar

To enable EachNavigationBar of a navigation controller

let nav = UINavigationController(rootViewController: vc)
nav.navigation.configuration.isEnabled = true

Setting

Global

let nav = UINavigationController(rootViewController: vc)
nav.navigation.configuration.titleTextAttributes = [.foregroundColor: UIColor.blue]
nav.navigation.configuration.barTintColor = UIColor.red
nav.navigation.configuration.backgroundImage = UIImage(named: "nav")
nav.navigation.configuration.shadowImage = UIImage(named: "shadow")

Each view controller

normal
navigation.bar  -> UINavigationBar
navigation.item -> UINavigationItem

// Remove blur effect
navigation.bar.isTranslucent = false

// If you need to set status bar style lightContent
navigationController?.navigationBar.barStyle = .black

// If you want change navigation bar position
navigation.bar.isUnrestoredWhenViewWillLayoutSubviews = true
additional
// override alpha & backgroundColor
navigation.bar.alpha -> UINavigationBar.barBackground.alpha
navigation.bar.backgroundColor -> UINavigationBar.barTintColor
largeTitle(iOS 11.0+)
// enable
if #available(iOS 11.0, *) {
    navigationController?.navigationBar.prefersLargeTitles = true
}
// show
if #available(iOS 11.0, *) {
    navigationItem.largeTitleDisplayMode = .always
}
// hide
if #available(iOS 11.0, *) {
    navigationItem.largeTitleDisplayMode = .never
}

Author

gaoX, [email protected]

License

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

Latest podspec

{
    "name": "EachNavigationBar",
    "version": "0.1.2",
    "summary": "A custom navigation bar of UIViewController.",
    "description": "A custom navigation bar of UIViewController addtion with CocoaPods support.",
    "homepage": "https://github.com/Ginxx/EachNavigationBar",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "gaoX": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Ginxx/EachNavigationBar.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "EachNavigationBar/Classes/**/*",
    "frameworks": "UIKit",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This