-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Learning Swift
By :

As you learned in Chapter 2, Building Blocks – Variables, Collections, and Flow Control, Swift is a strongly typed language, which means that every piece of data must have a type. Not only can we take advantage of this to reduce clutter in our code, we can also leverage it to let the compiler catch bugs for us. The earlier we catch a bug, the better. Besides not writing them in the first place, the earliest place we can catch a bug is when the compiler reports an error.
The two big tools that Swift provides to achieve this are called protocols and generics. Both of them use the type system to make our intentions clearer to the compiler, so that it can catch more problems for us.
In this chapter, we will cover:
Change the font size
Change margin width
Change background colour