'How to change title Color? swift 5

I can't change title color, which is white by default and when my background color is white too, it's invisible. How can i change it to the black color? enter image description here



Solution 1:[1]

Try this

self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.red]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MBT