April 2026
Intermediate
683 pages
25h 29m
English
Swift comes with a bag full of built-in protocols ready to be used for your convenience in your developments. And guess what: You may have already used them throughout the book, without us necessarily naming them as protocols yet. For example, the == token corresponds to the Equatable protocol, while the <= token corresponds to the Comparable protocol.
If you’re a little confused, don’t worry; we’ll cover those two protocols in this section, followed by some other common ones.
In Swift, Equatable is a protocol that allows you to compare two values using the == operator. Any type conforming to Equatable can be compared, as in a == b. In this section, we’ll go over class and struct examples ...
Read now
Unlock full access