O'Reilly logo

Swift 3 ObjectOriented Programming - Second Edition by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, you learned about the different members of a class or blueprint. We worked with instance properties, type properties, instance methods, and type methods. We worked with stored properties, getters, setters, and property observers, and we took advantage of access modifiers to hide data.

We worked with superheroes and defined the shared properties of a specific type of lion superhero using type properties. We also worked with mutable and immutable versions of a 3D vector, following the recommendations included in the Swift API Design Guidelines. You also understood the difference between mutable and immutable classes.

Now that you have learned to encapsulate data with properties, you are ready to create class hierarchies to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required