You can set custom font in two ways : design time
and run-time
.
First you need to download required font
(.ttf file format). Then, double click on the file to install it.
This will show a pop-up. Click on 'install font
' button.
'Fonts'
window.Add to targets
' is checked.Copy Bundle Resources'
present in Build Phases
of Targets
of your project.Info.plist
of your project.
Create a new key with 'Font Provided by application
' with type as Array.
Add a the font as an element with type String in Array.A. Design mode :
Font
attribute present in Attribute inspector
of Utilities
.B. Run-time mode :
self.lblWelcome.font = UIFont(name: "BananaYeti-Extrabold Trial", size: 16)
It seems that run-time mode doesn't work for dynamically formed string like
self.lblWelcome.text = "Welcome, " + fullname + "!"
Note that in above case only design-time approach worked correctly for me.