How to Create the iPhone User Interface for Your iOS App

By Jesse Feiler

Many times, iOS app programmers will write code for the iPad. All the code that you write for the iPad will work fine for the iPhone. All you need to do is add the following items to your iPhone storyboard file, in a very similar manner to what you just did for the iPad storyboard:

  • Drag a UIViewController into the iPhone storyboard. Change its class name to TestDriveController and its Storyboard ID to TestDrive.

  • Add a UIImageView, using the image SeeTheUSA_iPhone.png.

  • Add a UIImageView, using the image CarImage.png.

  • Add a Test Drive button.

  • Select the Master View Controller scene in the iPhone storyboard.

  • Select the Table view in the Master View Controller.

  • Use the Attributes inspector to change the Master view from Dynamic Prototypes to Static Cells.

  • Select the Label in the first Table View cell, and change its text to Test Drive.

  • Control-drag from the Table View cell to the TestDriveController; choose a Push segue from the pop-up menu.

  • Select the unused Table View cells from the Table view and delete them.

Now the iPhone app should work in a similar manner to the iPad app.