There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "This code creates a place in the memory, called text, where we store the text, Hello world!."
A block of code is set as follows:
func generateGreeting(greet:String, thing:String = "world") -> String {
return greet + thing + "!"
}
print(generateGreeting(greet: "Hello "))
print(generateGreeting(greet: "Hello ", thing: " Swift 4"))
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
let number = 5
let divisor = 3
let remainder = number % divisor //remainder is again integer
let quotient = number / divisor // quotient is again integer
Any command-line input or output is written as follows:
swift package init --type library
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Also, add an action to the Sign In With Email button."
Warnings or important notes appear like this.
Tips and tricks appear like this.