Skip to content

Latest commit

 

History

History
73 lines (47 loc) · 2.46 KB

README.md

File metadata and controls

73 lines (47 loc) · 2.46 KB

NavigationDropdown

'NavigationDropdown', a lightweight and elegant in Swift

Version License Platform Swift

Usage

To create a NavigationDropdown from UINavigationBar

Basic

NavigationDropdown works by showing a child UIViewController as a dropdown from a NavigationTitleButton. The most common use case is to show from a UINavigationController, in that sense, you can just create a list of items, and provide to NavigationTitleButton.

let items = ["World", "Sports", "Culture", "Business", "Travel"]
let titleView = NavigationTitleButton(with: self, items: items, selectedItem: nil)
titleView?.itemSelectionHandler = { [weak self] index in
  print("select \(index)")
}

navigationItem.titleView = titleView

Configuration

You can also customize many aspects of NavigationDropdown via Config

Config.List.DefaultCell.Text.color = .red

Installation

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

pod 'NavigationDropdown'

NavigationDropdown is also available through Carthage. To install just write into your Cartfile:

github "salientsys/navigation-dropdown-ios"

NavigationDropdown can also be installed manually. Just download and drop Sources and Resources folders in your project.

Author

Credit

Contributing

We would love you to contribute to NavigationDropdown, check the CONTRIBUTING file for more info.

License

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