SWIFT Example
suggest changeThis sample is Swift 3. The optional navigationController does nothing when this controller is not on a navigation stack. UIFont(name:size:) is nil when that face is not installed, and the force unwrap crashes.
navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white, NSFontAttributeName:UIFont(name: "HelveticaNeue-CondensedBold", size: 17)!,]
navigationController?.navigationBar.tintColor = .white
navigationController?.navigationBar.barTintColor = .red
navigationController?.navigationBar.isTranslucent = false
navigationController?.navigationBar.barStyle = .black
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents