Animals Tutorial Lesson 8

Adding an App Title with Custom Google Fonts

  1. Add a title to your app
    1. Drag a title label onto the storyboard above the seven buttons
    2. Center the label horizontally
    3. Put a little vertical spacing between the label and the Cheetah button
    4. Give the app a title like "My Favorite Animals"
    5. Make the font larger.
    6. Open the color picker to change the text color.
    7. Choose the eyedropper.
    8. Select one of the button backgrounds.
  2. Go to Google Fonts and find a nice font.
    1. Click the Add To Collection button.
    2. Click the Use button.
    3. Click the checkboxes next to all options you like: Bold, Italic, etc.
    4. Click the download button.
    5. Download as a zip file.
  3. Install the Google Font in your app.
    1. Open the downloads folder.
    2. Unzip the font file if necessary.
    3. Drag the font files into your project.
  4. Use the Google Font in your app.
    1. Close your Xcode project.
    2. Open your Xcode project again.
    3. Go to the Storyboard.
    4. Select your title label.
    5. Choose Custom font.
    6. Find your font in the list of fonts.
    7. Make the font larger or smaller if desirable.
    8. From the triangle tool, choose Update Frames. This will re-center your label.
    9. Select each of your fonts in the Project Navigator, and make sure they are checked off for Target Membership in the panel on the right. (See the resource above for more details.)
    10. Include the font in your bundle: Click the project, then Build Phases, and make sure the fonts are in the Bundle Resources. (See the resource above for more details.)
    11. Put the fonts in your Info.plist file. 
      1. Add a new row, "Fonts provided by application." 
      2. Open the array and add each of your fonts, making sure that you spell them accurately.
  5. Use the same font for the label at the top of the Animal View Controller that holds the animal name. 
  6. Update the frames if necessary.

No comments:

Post a Comment