Wednesday, May 4, 2016

Add Custom Fonts To Your iOS App

Tutorial on using a custom font
  1. Get your font
    Go to your favorite font website and download a font. I will go to http://www.dafont.com/ and download one. Unzip the download and you should see a *.ttf file.
  2. Add to your project
    Drag and drop the *.ttf file directly into your Xcode project. A dialog will appear. Make sure you add checkmarks to Destination and your target application.
  3. Add to your info.plist
    Select the last item in your info.plist and click the "+" button. Select "Fonts provided by application" (start typing in "Fonts" and it will show up). Expand this item and in the empty space next to "Item 0" type in the full name of your font file. (I just copy and paste the file name.)
  4. Change the font on your label
    Add a label to your UI and change the font. You have to select "Custom" first. Then you can change the font's family to your custom font's name.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

SwiftUI Search & Filter with Combine - Part 3 (iOS, Xcode 13, SwiftUI, 2...

In part 3 of the Searchable video series, I show you how to use Combine in #SwiftUI for the search and filter logic connected to the searcha...