-
Book Overview & Buying
-
Table Of Contents
Mastering Swift 5.3 - Sixth Edition
By :
In most traditional object-oriented programming languages, we create classes (which are reference types) as blueprints for our objects. In Swift, unlike other object-oriented languages, structures have much of the same functionality as classes, however, they are value types. Apple has said that we should prefer value types, such as structures, to reference types, but what are the differences between a reference type and a value type?
In this chapter, you will explore the following topics:
Equatable protocolAs we saw in Chapter 8, Classes, Structures, and Protocols, we have the ability to create our custom types as either a reference type (or class) or a value type (or structure). Let's review the differences between these two types...