课程: Swift 5 Essential Training

The quest begins: Variables

- If you think about a programming language in physical terms, variables and types are it's building blocks, it's atoms. They're the foundation and come in different shapes and sizes according to their functions. In this chapter, we're going to work with basic variable types common to all languages, including strings, integers, and Booleans. We'll also be introducing optional types, which are unique to Swift. These allow us to gracefully handle variables with nil values without bringing our code to a crashing stop. We've got a lot to cover, so let's start out on our Swift adventure.

内容