Properties: Two More Features

The current version of CarValet is all you need for the next chapter. This section covers two different variations of the project. Each variation comes with the sample code for this chapter.

Some of you might be wondering if it is a good idea to change the make, model, and year of a car after it has been created. So far, you have been using properties in their default read and write configuration. However, it is easy to set a property to read only. All you have to do is add a little extra when declaring a property. The general form of the property declaration is the following:

@property <(qualifier1, qualifier2, ...)> <type> <property_name>;

You have already used the type and property_name ...

Get Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.