Skip to content

Glossary: Swift Beyond the Basics

Comparable

A standard protocol for types that can be ordered. You write the `<` operator and Swift builds `>`, `<=`, `sorted()`, `min()` and `max()` from it.

Where the book teaches it

Related terms

HashableIdentifiableEquatableconstraint