9.6 Summary
In this chapter, you learned about classes in Swift. We started with the distinction between structs and classes. The most significant difference is that structs are value types, while classes are reference types. Classes also offer additional function types, like deinitialization and convenience initialization.
One option available for classes is inheritance, via which a child class can inherit properties and functions of a parent class as a starting point and add its own logic to that. Although the usage of inheritance is a controversial topic, the facility is there for when you need it. Finally, you learned about Swift’s object memory mechanism called ARC and how to deal with mutual referring objects via weak and unowned references. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access