Configuring the SubscribeController View

Use Interface Builder to configure the SubscribeController.xib file and create the user interface. Although the provided XIB file is already configured, you can walk through the steps to see how to create the interface.

  1. Click the SubscribeController.xib file to reveal a view of the (presently empty) screen in the right pane and the following three items represented by icons in the middle pane:
    • File's Owner – the object that is set to be the owner of the user interface, which is typically the object that loads the interface. In this tutorial, this is the SubscribeController.


      SUP iOS Tutorial - File's Owner icon

    • First Responder – the first responder proxy object handles events. Connecting an action to the first responder means that when the action is invoked, it is dynamically sent to the responder chain.


      SUP iOS Tutorial - First Responder icon

    • View – displayed in a separate window to allow you to edit it.


      SUP iOS Tutorial - View icon

  2. Select the File's Owner icon, select View > Utilities > Identity Inspector, and make sure SubscribeController appears in the Class field under Custom Class.

    SUP iOS Tutorial - SubscribeController class
    This tells Interface Builder the class of the object to allow you to make connections to and from the File's Owner.
  3. Click the View icon, and in the Identity Inspector panel, and make sure UIView appears in the Class field under Custom Class.

    SUP iOS Tutorial - UIView class
  4. To create a Subscribe button, select View > Utilities > Object Library.
    1. In the Object Library panel, select the Round Rect Button item, drag it onto the view.

      SUP iOS Tutorial - Round Rectangle Button object
    2. Double-click it and enter Subscribe and press Return.
  5. In the Accessibility section of the Identity Inspector, make sure Enabled is unselected.
    Disable the button because the application cannot subscribe to the server for updates until it is connected.
    SUP iOS Tutorial - Disable Accessibility
  6. Control-click the Subscribe button to show the inspector.
  7. Drag from the circle to the right of Touch Up Inside to the File's Owner icon and release, then click on buttonPressed to establish a connection between the Subscribe button and the button's action method:

    iphone_subscribe_button_connect