0

installed fonts for title navigation bar

UINavigationBar.appearance().titleTextAttributes = [.font: UIFont(name: "OpenSans", size:50 )!,NSAttributedString.Key.foregroundColor : UIColor.purple]

how do I make it bold ?

found, that can be done so, but after all the fine print I already set

.font : UIFont.boldSystemFont(ofSize: 50)
Lolidze
  • 219
  • 2
  • 13

2 Answers2

1

You have to say that font you want to use is named OpenSans with style Bold

"OpenSans-Bold"

So use this:

.font: UIFont(name: "OpenSans-Bold", size: 50)!
Robert Dresler
  • 10,580
  • 2
  • 22
  • 40
1

You should use the bold version of Open Sans. Instead of "OpenSans" use the string that corresponds with the bold version ex. "OpenSans-Bold"

UINavigationBar.appearance().titleTextAttributes = [.font: UIFont(name: "OpenSans-Bold", size:50 )!,NSAttributedString.Key.foregroundColor : UIColor.purple]

The font name will be specific to your environment.

elismm
  • 237
  • 3
  • 12
  • tnx, for `Tsukushi A Round Gothic ` font how will be? `Tsukushi A Round Gothic-Bold ` - dont work – Lolidze Dec 04 '18 at 18:44
  • Please see this [link](https://stackoverflow.com/a/27147786/7978419) @Lolidze It will have the answer that you need. – elismm Dec 04 '18 at 19:27