Member-only story

Overriding the default font in Swift

Want to change all of the default fonts in your App, in one fell swoop?

Steven Curtis
1 min readSep 26, 2019

Prerequisites:

  • Be able to use Xcode (certainly to create an App!)
  • Be able to install custom fonts in your App

Terminology

TTF: TrueType Fonts, that were originally developed by Apple

OFT: OpenType Fonts, a relatively newer font that has been based on the TrueType standard

The implementation

You will need to have added a custom font into your project, and of course have linked to this through your .plist file. Done? No problem.

I set up a Resources.swift file with the following contents:

And then this can be called from AppDelegate (for example didFinishLaunchingWithOptions)

--

--

No responses yet