I know that to set a custom font of an element on the screen I can simply dosomeLabel.font=UIFont(name: \"Exo 2.0\", size: 15)
.
I was wondering how one
FINALLY figured this out. Cleanest way I could find. (Swift 4) Solution doesn't require you to set font sizes and won't override all font sizes.
UILabel.appearance().font = UIFont.preferredFont(forTextStyle: UIFontTextStyle(rawValue: "Roboto"))
For those looking for where to place this code. I put it in my AppDelegate.swift file inside of
func application(_ application: UIApplication,
didFinishLaunchingWithOptions...
Swift 4.2
UILabel.appearance().font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle(rawValue: "Roboto"))