Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Launch the Keychain Access application, which can be found in the /Applications/Utilities
folder."
A block of code is set as follows:
Override func willActivate() { Super.willActivate() guessLabel.setText("Your Guess is: + String(Int(yourGuess))) guessLabel.setTextColor(UIColor.yellowColor()) }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
// Method to handle the Encryption func encryptString(str: String, withPassword password: String) throws -> String { guard password.characters.count > 0 else { throw EncryptionError.Empty } guard password.characters.count >= 5 else { throw EncryptionError.Short } // Begin constructing our encrypted string let encrypted = password + str + password return String(encrypted.characters.reverse()) }
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "To run the app, select the GuessingGame WatchKit App scheme as shown in the following screenshot and then select your preferred device."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.