Chapter 7: Classes, Structures, and Enumerations

In the last chapter, you learned how to group instruction sequences together using functions and closures.

It's time to think about how to represent complex objects in your code. For example, think about a car. You could use a String constant to store a car name and a Double variable to store a car price, but they are not associated with one another. You've seen that you can group instructions together to make functions and closures. In this chapter, you'll learn how to group constants and variables together in a single entity using classes and structures, and how to manipulate them. You'll also learn how to use enumerations to group a set of related values together.

By the end of this chapter, ...

Get iOS 14 Programming for Beginners - Fifth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.