Chapter 7: Getting Started with Interface Builder

Although Interface Builder (IB) can be used as a UI editor, you must understand that it’s a more general object management tool.

Understanding IB

Figure 7.1 shows a first look at IB. In Xcode, IB has five functions:

  • You can use IB to design your application’s UI. The UI design includes one or more windows and views, with associated controls—objects such as buttons, sliders, text boxes, and so on. The design process presets the properties of these objects. For example, you can set the default position of an OS X window and control whether it has a drop shadow. Similarly, when you add a button to a UI, you use IB to set its position in the window or view, set its color, and so on. Optionally, you can define custom graphics and other more specialized features.
  • You can use IB to pre-instantiate objects in your application. Any object you add to a nib file is created in memory when the file is loaded. This option is completely general: Objects do not have to be visible on screen or be part of a UI. The standard application templates for both iOS and OS X rely on this feature to load the core application classes.
  • You can use IB to create your own kit of UI objects. Very advanced developers can create a complete external library of custom UI objects, with associated code. This ...

Get Xcode 5 Developer Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.