Swift itself has a lot of features to offer that make writing clean and understandable code easier. In this section, we will look at examples that demonstrate some of those features. Swift has remarkably many modern features in contrast to other languages, such as Go or Rust. By the end of this section, you should know how to use some of them well. Using them not only helps you write better code, but it also improves the performance of your application as you use Swift in the way that it was intended.
We will look into the following features:
- Using extensions to enhance objects with new functions
- Exploring protocols that allow you to define the interface for your code
- Understanding the difference between classes and structs
Let's take a look!