1 / 10

Storyboards II

Storyboards II. Tabs and Tables. Overview. Create a single view application Give the project a name and click “Use Storyboards” and “Use Automatic Reference Counting” Save it somewhere. Do not create a git directory. There’s no nib; instead the storyboard represents several views.

jolene
Télécharger la présentation

Storyboards II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Storyboards II Tabs and Tables

  2. Overview • Create a single view application • Give the project a name and click “Use Storyboards” and “Use Automatic Reference Counting” • Save it somewhere. Do not create a git directory There’s no nib; instead the storyboard represents several views

  3. The storyboard • Select the MainStoryboard.storyboard file No icon view When you click on View Controller in the doc, you get 3 icons: each View in the storyboard has these icons. This is called a scene This arrow shows which view controller is the initial view controller for this storyboard. Can drag this arrow to another view (if there was one) Exit View Controller First Responder

  4. The storyboard • Select the MainStoryboard.storyboard file No icon view When you’re zoomed out you cannot select components or drag new components to the view Zoom buttons Change between iPhone 4 size and iPhone 5 size Editing conttrols

  5. Testing • Add label. • Run.

  6. Second Controller • Select the storyboard and add a new view controller • Put a label on the first view controller’s view that says “View Controller 1” • Put a label on the second view controller’s view that says “View Controller 2” • Select the first view controller and invoke the following menu command • Editor ⇒ Embed In ⇒ Tab Bar Controller • A Tab Bar Controller is added and the first view controller has been automatically configured to be its first tab (!) • Your storyboard should now look similar to the next slide

  7. Tabs

  8. Second Tab • Control-Click on the Tab Bar Controller and drag to the second view controller • Let go and a menu appears with more options than in our previous example • In particular, there’s a new section called “Relationship Segue” and a choice under that which says “view controllers” • Select the “view controllers” choice • this essentially says that we’d like the second view controller to be one of the view controllers managed by the tab bar controller • You should see a Tab Bar with two tabs • If you run it, you can click on the two tabs to see your two view controllers in action • Tabs

  9. Tab bar buttons • Add two icons to the project • Click on the first view controller. Then click on its tab icon. • Go to the attributes inspector. • Give each a name and an icon • Repeat with second controller • Run. • Tabs

  10. Files

More Related