Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

6.4. Building the App

Section 6.4.1 presents the MainView and class MainViewController. Section 6.4.2 presents the FlipsideView and class FlipsideViewController.

6.4.1. The MainView and Class MainViewController

Open Xcode and create a new Utility Application. Remember to drag the folders containing this example’s images from the Finder into the project’s Resources group. Open MainView.xib in Interface Builder. Center a Label at the top of the screen and set its text to 10 Question Flag Quiz. Set the Label’s Minimum Font Size to 27 in the Inspector window. Drag an Image View to the top of the app window. This Image View displays the flag images. Next, center a Label underneath the Image View, then change its text to Select the country. Drag two more Labels onto the app window. Center the first Label near the bottom of the app and set its Minimum Font Size property to 30—this Label is used to display whether each answer is correct or incorrect. Set this Label’s text to Answer. You’ll soon see how to hide the Label until the user selects an answer. The Label in the bottom-left corner will display the user’s progress—showing the number of flags seen so far in the quiz. Set this Label’s text to Question 0 of 10. Figure 6.6 shows the completed layout for MainView.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint