How to Implement Custom Fonts in iOS Without code changes

Amir Kamali
6 min readAug 12, 2021

Background

Using custom fonts has been challenging in iOS since the beginning. Normally you have to register your fonts through plist properties, find the names, font family and bring it to your code. After doing all these steps, you’re just at the beginning of the challenge.

Knowing how to change the font might be good, but as a good practice, you also need to have a good strategy in place so you can apply custom font to all visual elements in your application such as labels, buttons, navigation controllers, etc and be able to swap them easily if required. Your workspace also might have existing Storyboards with a lot of content and updating all visual elements can be challenging.

In this article we’re going to review some of the ways you can achieve custom font goal in UIKit and SwiftUI. I will also describe the way I believe it’s the most flexible way in UIKit.

Install custom fonts:

Drag & Drop your fonts to the project folder, make sure you copy them to the project

Register Fonts

2A- Register font names using FontBlaster:

FontBlaster is a very lightweight class that allows you to load custom fonts from your app bundle. This saves you a lot of time from entering and managing font names in the plist.
https://github.com/ArtSabintsev/FontBlaster

All you need to do is copy FontBlaster.Swift to your project and use the following code at the start up:

FontBlaster.blast()OR: // Custom bundle is passed as argument
FontBlaster.blast(bundle:) { (fonts) in
print(fonts) // access all the font names in an array of Strings
}

2B- Register fonts using plist
As an alternative way you can manually register fonts per Apple’s original documentation.
For this, add the key “Fonts provided by application” to Info.plist and add your font names inside the array similar to the screenshot below:

--

--

Amir Kamali

ex. Director of Mobile & OTT at AMC Networks, ex. Engineering Manager at Tile / Life360