Chapter 7: Getting Started with Interface Builder

In This Chapter

Understanding nib files Getting started with IB Creating a simple iOS project with IB Comparing IB in Xcode 4 with Xcode 3

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

In Xcode, IB has five functions:

bl.eps 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.

bl.eps 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 ...

Get Xcode® 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.