Adding Outlets and Actions to Your RoadTrip Code
In This Chapter
Connecting your user interface to your code
Using the Assistant
Taking advantage of the Connections inspector
How connections are made at runtime
As I explain in Chapter 3, one of the things that the RoadTrip app will be able to do is send the image of a car to the top of the screen, have it turn around, have it move back down the screen, and then have it turn around again so it’s back where it started, all from a simple tap of the Test Drive button. Fun times.
For all that to happen, you’re going to need to add some logic to your code. You do that in a custom view controller, which gets detailed coverage in this very chapter — especially the bits about adding custom view controllers and connecting them to the view controllers you create in your storyboard. But that’s only one part of the story. For all the pieces to fit, you’ll need to be able to access the elements stipulated in your storyboard — elements like the car image — and then connect those elements to the code in your custom view controller.