GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - GitHawkApp/DropdownTitleView: A UINavigationItem.titleView compatible UIControl with a title, subtitle, and dropdown.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
DropdownTitleView.xcodeproj
DropdownTitleView.xcodeproj
 
 
DropdownTitleView.xcworkspace
DropdownTitleView.xcworkspace
 
 
Pods
Pods
 
 
Source
Source
 
 
Tests
Tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
DropdownTitleView.podspec
DropdownTitleView.podspec
 
 
LICENSE
LICENSE
 
 
Podfile
Podfile
 
 
Podfile.lock
Podfile.lock
 
 
README.md
README.md
 
 
readme.png
readme.png
 
 

Repository files navigation

DropdownTitleView

A simple and configurable "dropdown" view built for UINavigationItem.titleView.

Installation

Just add DropdownTitleView to your Podfile and pod install. Done!

pod 'DropdownTitleView'

Usage

Create an instance of DropdownTitleView, configure it, and set it as a UINavigationItem's titleView:

func viewDidLoad() {
  super.viewDidLoad()
  let titleView = DropdownTitleView()
  titleView.configure(title: "Hello world!", subtitle: "Is this thing on?")
  navigationItem.titleView = titleView
}

Example

Add touch handling like you would any other UIControl:

func viewDidLoad() {
  super.viewDidLoad()
  // setup and set titleView
  titleView.addTarget(
    self, 
    action: #selector(onTitle), 
    for: .touchUpInside
  )
}

@objc func onTitle() {
  print("do something")
}

Configuration

DropdownTitleView has several appearance options:

  • titleFont and titleColor - UIFont and UIColor of the top title label
  • subtitleFont and subtitleColor - UIFont and UIColor of the bottom subtitle label
  • chevronTintColor - UIColor tint of the chevron image

All of these values are configurable via UIAppearance as well!

DropdownTitleView.appearance().chevronTintColor = .blue
DropdownTitleView.appearance().titleColor = .black
DropdownTitleView.appearance().subtitleColor = .lightGray
DropdownTitleView.appearance().titleFont = .systemFontOfSize(18)
DropdownTitleView.appearance().subtitleFont = .systemFontOfSize(13)

You can also control the features of the view with params in configure(...) function:

  • subtitle - Leave nil to remove the subtitle and vertically center the title
  • chevronEnabled - Set to false to remove the chevron
  • accessibilityLabel and accessibilityHint - Set Accessibility features on the control

Acknowledgements

  • Created with ❤️ by Ryan Nystrom

About

A UINavigationItem.titleView compatible UIControl with a title, subtitle, and dropdown.

Topics

githawk

Resources

Readme
MIT license
Activity
Custom properties

Stars

248 stars

Watchers

4 watching

Forks

12 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.