About the cover

Flying fish have been known to soar 655 feet in a single flight, can reach heights of 20 ft above the water, and may fly as fast as 37 mph.

If you ever feel like a fish out of water trying to learn Swift, just think about the animals on the cover of this book — if they can adapt to a completely new environment, so can you! :]

The chapters in this section will introduce you to the very basics of programming in Swift. From the fundamentals of how computers work all the way up to language structures, you’ll cover enough of the language to be able to work with data and organize your code’s behavior.

The section begins with some groundwork to get you started:

    • Chapter 1, Coding Essentials & Playground Basics: This is it, your whirlwind introduction to the world of programming! You’ll begin with an overview of computers and programming, and then say hello to Swift playgrounds, which are where you’ll spend your coding time for the rest of this book.

Next, you’ll learn the basics of data in Swift:

    • Chapter 2, Expressions, Variables & Constants: You’ll start by learning some basics such as code comments, arithmetic operations, constants and variables. These are some of the fundamental building blocks of any language, and Swift is no different.
    • Chapter 3, Types & Operations: You’ll learn about handling different types, including strings which allow you to represent text. You’ll learn about converting between types and you’ll also be introduced to type inference which makes your life as a programmer a lot simpler. You’ll learn about tuples which allow you to make your own types made up of multiple values of any type.

Once you have the basic data types in your head, it’ll be time to do things with that data:

    • Chapter 4, Basic Control Flow: You’ll learn how to make decisions and repeat tasks in your programs by using syntax to control the flow. You’ll also learn about Booleans, which represent true and false values, and how you can use these to compare data.
    • Chapter 5, Repeating Steps: Continuing the theme of code not running in a straight line, you’ll learn about another loop known as the for loop. You’ll also learn about switch statements which are particularly powerful in Swift.
    • Chapter 6, Functions: Functions are the basic building blocks you use to structure your code in Swift. You’ll learn how to define functions to group your code into reusable units.

Swift Apprentice Section I: Swift Basics

The final chapter of the section loops a very important data type:

  • Chapter 7, Optionals: This chapter covers optionals, a special type in Swift that represents either a real value or the absence of a value. By the end of this chapter, you’ll know why you need optionals and how to use them safely.

These fundamentals will get you Swiftly on your way, and before you know it, you’ll be ready for the more advanced topics that follow. Let’s get started!

Welcome to our book! In this first chapter, you’re going to learn a few basics. You’ll learn how code works first. Then you’ll learn about the tools you’ll be using to write Swift code.

results matching ""

    No results matching ""