Latest 0.4.1
Homepage https://github.com/Pircate/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

EachNavigationBar

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")
nav.navigation.configuration.backImage = UIImage(named: "back")

Each view controller

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

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

// hide bottom black line
navigation.bar.shadowImage = UIImage()
// if version < iOS 11.0, also need:
navigation.bar.setBackgroundImage(UIImage(), for: .default)

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

// If you want change navigation bar position
navigation.bar.isUnrestoredWhenViewWillLayoutSubviews = true
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
}

For Objective-C

AYNavigationBar

Author

Pircate, [email protected]

License

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

Latest podspec

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

Pin It on Pinterest

Share This