How to Set Up the DestinationController in the Main_iPad.storyboard in Your iOS App - dummies

How to Set Up the DestinationController in the Main_iPad.storyboard in Your iOS App

By Neal Goldstein, Dave Wilson

Once you have a custom view controller in your iOS app, you need to tell the storyboard to load your custom view controller rather than a UIiewController. Follow these steps:

  1. In the Project navigator, select the Main_iPad.storyboard file, and in the Document Outline, select View Controller in the View Controller – Destination Scene.

  2. Open the Identity inspector in the Utility area using the Inspector selector bar and then choose DestinationController from the Custom Class section’s Class drop-down menu.

    Now when Destination is selected in the Master View controller, DestinationController will be instantiated and initialized and will receive events from the user and connect the view to the model.

  3. Select the segue to the Destination controller on the Canvas.

  4. Select the Attributes inspector for the Inspector selector bar.

    A modal dialog requires the user to do something (tap a Table View cell or the Cancel button, for example) before returning to the app.

    When you have a modal segue, you can choose a transition style.

  5. Choose Flip Horizontal in the Transition pop-up menu in the Attributes inspector for the segue.

    Actually, you can select whatever transition you’d like, but go for Flip Horizontal.

Make sure that Form Sheet is selected in the Presentation pop-up menus. The Presentation choices include

  • Full Screen: The modal view covers the screen.

  • Page Sheet: The height and width are set to the height and width of the screen in Portrait orientation, with the background view dimmed.

  • Form Sheet: The width and height of the modal view are smaller than those of the screen, with the modal view centered on the screen and the background view dimmed.

  • Current Context: The modal view is the same style as its presenting view controller. But if the presenting view controller is in a popover, you can use this presentation style only when the transition style is UIModalTransitionStyleCoverVertical. If not, you’ll get an exception.