Adding the Taxi View with Drag

Follow these steps to enable dragging the car view:

1. Open AboutViewController.xib in IB.

2. Add an image view above the text and set image to placeholder and the background color to lemon.

3. While you are in the XIB, fix the centering of the existing text so it works on the iPad. Select the label and set the constraints to horizontally and vertically centered in the container.

Now set the taxi view constraints to the following: The bottom is the system distance from the top of the label, the width and height are fixed at 40, and it is horizontally centered in the superview.

4. Select the image view and check User Interaction Enabled in the Attributes inspector. This flag enables the image view to receive gestures. ...

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.