ADNavigationBarExtension

iOS UI library to show and hide an extension to your UINavigationBar

Showing:

Popularity

Downloads/wk

0

GitHub Stars

52

Maintenance

Last Commit

3mos ago

Contributors

2

Package

Dependencies

1

License

MIT

Categories

Readme

ADNavigationBarExtension is a UI library written in Swift. It allows you to show and hide an extension to your UINavigationBar

Platform Swift5 CocoaPods License


Features

Use ExtensibleNavigationBarNavigationController to set an extension under your UINavigationBar:

  • The navigation controller manages the displaying of your navigation bar's extension
  • It is compatible with UIAppearance

See the provided examples for help or feel free to ask directly.



Requirements

ADNavigationBarExtension is written in swift 5.0. Compatible with iOS 10.0+

Installation

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

Cocoapods

pod 'ADNavigationBarExtension'

Usage

Setup

The main component of the library is the ExtensibleNavigationBarNavigationController. It is basicaly a simple UINavigationController wich manages a supplementary view under the UINavigationBar.

A startup sequence might look like this:

let navigationController = ExtensibleNavigationBarNavigationController()
let navigationBarExtension = MyCustomView()
let navigationBarExtensionHeight = 64
navigationController.setNavigationBarExtensionView(navigationBarExtension, forHeight: navigationBarExtensionHeight)
navigationController.pushViewController(MyViewController(), animated: false)
window.rootViewController = navigationController

Then the ExtensibleNavigationBarNavigationController needs to know when the navigation bar's extension needs to be displayed or to be hidden. You have to use the protocol ExtensibleNavigationBarInformationProvider:

extension MyViewController: ExtensibleNavigationBarInformationProvider {
    var shouldExtendNavigationBar: Bool { return true }
}

Warning

Be aware of ExtensibleNavigationBarNavigationController is using the UINavigationControllerDelegate protocol. So if you also need to use de navigationController's delegate proprerty, you can use this:

let navigationController = ExtensibleNavigationBarNavigationController()
navigationController.navigationControllerDelegate = self

There is an issue with iOS 12 where the isTranslucent property cannot be retrieved from the UINavigationBar.appearance() method. So if you need to set your UINavigationBar translucent, you can use this:

ExtensibleNavigationBarNavigationController.ad_isTranslucent = true

Credits

ADNavigationBarExtension is owned and maintained by Fabernovel. You can follow us on Twitter at @FabernovelApp.

License

ADNavigationBarExtension is released under the MIT license. See LICENSE for details.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100