How to Add the Events Custom View Controller to Your iOS App

The Events feature actually requires that you add a number of interrelated components to each storyboard file in your iOS app. To add the EventsController to your iOS app project, follow these steps:

  1. In the Project navigator, select the View Controller Classes group and then either right-click the selection and choose New File from the menu that appears or choose File→New→File from the main menu (or press ⌘+N).

    Whatever method you choose, you’re greeted by the New File dialog.

  2. In the left column of the dialog, select Cocoa Touch under the iOS heading, select the Objective-C class template in the top-right pane, and then click Next.

    You’ll see a dialog that will enable you to choose the options for your file.

  3. Enter EventsController in the Class field, choose or enter DetailViewController in the Subclass Of field, make sure that the Target for iPad check box is selected and that With XIB for User Interface is deselected, and then click Next.

  4. In the Save sheet that appears, click Create.

You'll also need to create a controller that manages each event page. Follow these steps:

  1. In the Project navigator, select the View Controller Classes group and then either right-click the selection and choose New File from the menu that appears or choose File→New→File from the main menu (or press ⌘+N).

    Say hello again to the New File dialog box.

  2. In the left column of the dialog, select Cocoa Touch under the iOS heading, select the Objective-C class template in the top-right pane, and then click Next.

    You’ll see a dialog that will enable you to choose the options for your file.

  3. Enter EventPageController in the Class field, choose or enter UIViewController in the Subclass Of drop-down menu, and make sure that the Target for iPad check box is selected and that With XIB for User Interface is deselected. Click Next.

  4. In the Save sheet that appears, click Create.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement

Inside Dummies.com