O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

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

Adding Car Display Behaviors

Displaying object information is another common task. A UILabel displays the string from its text attribute in the interface, using whatever font, size, and color you specify. When the text attribute changes, the label updates.

You need four things to use UILabel for displaying changing information: a label, a connection to that label, a string to display, and code to set the label’s text.

You have already added the car information label to your scene. You have also created a connection, an IBOutlet, to that label. Adding a description for a car can be done in a few ways. One is by adding a public method. Another is using a read-only property and custom getter. Implement the property and getter by following these ...

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