How do I add a custom font to my iOS app?

Unhappy with the default font options available as you build your iOS app? You can add your own custom fonts by associating them via Xcode. To start, you will need the font files (.ttf or .otf) you are looking to embed. If you're looking for free fonts, Google Fonts or Fontsquirrel are great places to start.

Adding Fonts

To add fonts to Xcode, select File > Add Files to "MyApp" from the menu bar.

Add your font files to the project making sure Copy items if needed is selected.

An image of the Xcode with a bunch of fonts selected

Configuring Info.plist

The next step is configuring Info.plist. In Info.plist, add the key Fonts Provided By Application (UIAppFonts). Then, add each font you want to embed in your app.

An image of Xcode on the bundle info screen showing fonts being added to the plist

Using your fonts in code

To use your custom font in a label or other UI element, use the following code:

   myLabel.font = UIFont(name: "OpenSans-Bold", size: 16)

Run your app and you should see your custom font!

Note: If you are developing a macOS app instead, follow the steps above but use NSFont instead of UIFont.

Home Knowledge Base Support Download