To make this book easier to read, certain items appear in certain fonts. Classes, types, methods, and functions appear in a bold, fixed-width font. Classes and types start with capital letters, and methods and functions start with lowercase letters. For example, “In the loadView() method of the RexViewController class, create a constant of type String.”
Variables, constants, and filenames appear in a fixed-width font but are not bold. So you will see, “In ViewController.swift, add a variable named fido and initialize it to "Rufus".”
Application names, menu choices, and button names appear in a sans serif font. For example, “Open Xcode and select New Project... from the File menu. Select Single View Application and then click Next.”
All code blocks are in a fixed-width font.
Code that you need to type in is bold; code that you need to delete is struck through.
For example, in the following code, you would delete the line import Foundation
and type in the two lines
beginning @IBOutlet
.
The other lines are already in the code and are included to let you know where to add the new lines.
import Foundationimport UIKit class ViewController: UIViewController { @IBOutlet var questionLabel: UILabel! @IBOutlet var answerLabel: UILabel! }