![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I change the text color of the Navigation Bar on iOS?
Changing the text color of the navigation bar is tricky and easy at the same time, In this post, we will be seeing how one can change the text color of navigation bar in swift.
So let’s get started,
Embed your view controller in Navigation controller as shown below and name navigation item for that particular controller as a tutorial as shown,
Now navigate to AppDelegate.swift and add below lines in didFinisheLaunchingWithOptions method.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. let textColor = [NSAttributedString.Key.foregroundColor:UIColor.green] UINavigationBar.appearance().titleTextAttributes = textColor return true }
Run the app, to see the effect we’ve changed the color to green here.
Advertisements