Graphics Reference
In-Depth Information
FIGURE 13-2
New Project Selection in Xcode
Building the UIWindow
This project template gives you the very bare bones of a structure and creates a nib for
you to work with. After you create the project, the first thing you want to do is make a
few changes to the nib. With the nib file open, you can see there is one Window, which is
the delegate for the
UIApplication
(aptly named
AppDelegate
, or a variation thereof), and
the File's Owner, which for the main nib is the
UIApplication
itself. As with all nib files,
we have the conveyance First Responder object, as shown in Figure 13-3.
The first changes we want to make are to add a button and a label to the window. The
button is a Rounded Rect Button from the library. Give it a title value of Draw. This
button will be placed directly on the Window and centered at the bottom. The button
can easily be centered by selecting the
Size
palette in Interface Builder and clicking on the
center horizontal button.
The second addition is a
UILabel
object that needs to be centered near the top and given
a title of Star. With this object, though, we want to use a little more precision for its align-
ment, so go to the Size Inspector and change its dimensions to 139
×
89, and its width to
42 with a height of 22, as shown in Figure 13-4.