Homework Assignment One

Create a new project with the following specifications.

  1. An introductory view (ContentView.swift) with links to three additional views.
  2. One of the views should
    1. In one text field, demonstrate the use of a custom font with a fixed font size. By the way, I had success with Courier, Cochin, Didot and a few other fonts, but couldn’t get many of the fonts installed on my computer to work properly for some reason, including the example from our text book.
    2. In another text field with a large amount of text, demonstrate how to implement a line limit of two. Ie. the text field should have more text inside than it actually displays.
    3. Add padding to at least one of the text fields.
    4. Add a font color to one of the text fields.
    5. Add a third text field and give it a background color. Hint:

      .background(Color.yellow) for example

  3. In a second view demonstrate the use of an SF symbol by using an airplane.
    1. Set its font size to 300 or thereabouts until it pretty much fills the screen.
    2. Add a rotation effect (from chapter 2 on text) so that it points straight up, like this.

    3. In the third view, display a large image of some sort. Set the image to resizable so that it fills the entire screen. Then use .scaledToFit() to insure that it is scaled proportionally. At this point it may not fill the entire screen in one of the dimensions, but that’s OK.
      1. Add an overlay to your image, set the color of the overlay to black, and set its opacity to a value that allows you to see the image, but still makes it darker. Hint: you will need to use a rectangle. See Chapter 3, Applying an Overlay to an Image.