Interface Builder

You are using the Single View Application template because it is the simplest template that Xcode offers. Still, this template has a significant amount of magic in that some critical components have already been set up for you. For now, you will just use these components, without attempting to gain a deep understanding of how they work. The rest of the book will be concerned with those details.

In the project navigator, click once on the Main.storyboard file. Xcode will open its graphic-style editor called Interface Builder.

Interface Builder divides the editor area into two sections: the document outline, on the lefthand side, and the canvas, on the right.

This is shown in Figure 1.8. If what you see in your editor area does not match the figure, you may have to click on the Show Document Outline button. (If you have additional areas showing, do not worry about them.) You may also have to click on the disclosure triangles in the document outline to reveal content.

Figure 1.8  Interface Builder showing Main.storyboard

Screenshot of the Interface Builder with its panels labeled.

The rectangle that you see in the Interface Builder canvas is called a scene and represents the only “screen” or view your application has at this time (remember that you used the single view application template to create this project).

In the next section, you will learn how to create a UI for your application using Interface Builder. Interface Builder lets you drag objects from a library onto the canvas to create instances and also lets you establish connections between those objects and your code. These connections can result in code being called by a user interaction.

A crucial feature of Interface Builder is that it is not a graphical representation of code contained in other files. Interface Builder is an object editor that can create instances of objects and manipulate their properties. When you are done editing an interface, it does not generate code that corresponds to the work you have done. A .storyboard file is an archive of object instances to be loaded into memory when necessary.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset