Skip to content

Instantly share code, notes, and snippets.

@amosavian
Created March 1, 2017 13:05
Show Gist options
  • Select an option

  • Save amosavian/cac21536e94340e493a759b5a2ffbb04 to your computer and use it in GitHub Desktop.

Select an option

Save amosavian/cac21536e94340e493a759b5a2ffbb04 to your computer and use it in GitHub Desktop.
for navsubview in (navigationController?.navigationBar.subviews ?? []) {
let classname = NSStringFromClass(type(of: navsubview))
guard classname.hasSuffix("View") && classname.hasPrefix("UINavigationItem") else { continue }
for labelView in navsubview.subviews where labelView is UILabel {
(labelView as! UILabel).textColor = .red
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment