Adding the Initial Add/View Behaviors

Every UI element you add to your app must show or do something relevant. Yes, some elements—such as the divider view and decorative images—serve other purposes. These decorations are useful only when used with items that show information, allow action, or show results of an action.

The interface you are working on now displays the total number of cars, the index of the car shown, and its detailed information. It also provides actions: creating a car and going to the next or previous car. Before you can create the code to respond to buttons or update labels, you need a way to know when the button is touched. You also need references to any labels you will change.

IBAction and IBOutlet

You use IB to add behaviors ...

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.