Get font families
Sometimes a design might require a custom font to be used. This summary outlines the resources and steps required to get your custom fonts setup in your build.
We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
I found this tutorial from Apple, so I created this post here as a bookmark to remind myself on how this works. This tutorial helps you understand what fonts are available in your application.
Within viewDidLoad()
add this code and run a build.
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
for family: String in UIFont.familyNames {
print("\(family)")
for names: String in UIFont.fontNames(forFamilyName: family) {
print("== \(names)")
}
}
}
}
You should see something like this in your xcode console
In order to add custom fonts, you need to follow some key steps. Everything is clearly outlined in the link below
Adding a Custom Font to Your App
If your build is missing the font or not showing up, make sure “Target Membership” is selected. And double check that you spelled the font correctly in your Info.plist. I always mess up on one of those steps.