Identifying the basic workspace components Setting up your workspace style Customizing windows and panes Getting information about items in your project Now that you have a bird ’ s eye
Trang 1Xcode Layout
WHAT'S IN THIS CHAPTER?
Identifying the basic workspace components Setting up your workspace style
Customizing windows and panes Getting information about items in your project Now that you have a bird ’ s eye view of how Xcode is organized, drop a few hundred feet and look at the visual layout of Xcode In this chapter, you learn how items are organized in the Xcode project window, how to choose a window layout style that you like, how to arrange and customize windows, and how to get information about your project
The project window, shown in Figure 3 - 1, represents your project and is your home base in Xcode All of the components that make up your project are organized here It is also the central means of browsing your project, allowing you to see the products that your project produces, symbols defi ned in your project, bookmarks you ’ ve saved, and other aspects All other windows in your project are subordinate to your project window Closing the project window closes the project and all other windows related to the project
➤
➤
➤
➤
Trang 220 ❘ CHAPTER 3 XCODE LAYOUT
Project content (source fi les, property lists, details, log output) is presented in individual windows or
in one or more panes that share a single window Some windows are always organized into multiple
panes, like the project and debugger windows Other windows, like editing windows, usually
consist of a single pane, but can often be split into multiple panes if you like You learn more about
this later in this chapter and in Chapter 6
Broadly, content presented in Xcode can be divided into fi ve categories: the project window, editing
panes, Info windows, fl oating windows, and utility windows
The project window is unique It contains the Groups & Files pane and the details pane These
panes do not appear in any other window Depending on your project layout style, the project
window can also include editing panes and present the content of other utility windows
Editing panes edit the content of source fi les, and are where you will be spending much of your time
during development Editing panes are often contained in their own window
Info windows display detailed information about an item in your project This is where you examine
the details and options for each item You can usually open an Info window by choosing Get Info,
either by clicking the toolbar button or choosing View ➪ Get Info Info windows vary depending on
the type of item being inspected Figure 3 - 2 shows a typical Info window for the project
FIGURE 3 - 1
Trang 3Xcode also presents transient information in fl oating windows and tool tips These include suggested code completions, API documentation, detailed error descriptions, and variable inspectors An example of a Quick Help window is shown in Figure 3 - 3
FIGURE 3 - 2
FIGURE 3 - 3
Trang 422 ❘CHAPTER 3 XCODE LAYOUT
Utility windows are the catch - all category for all of the other kinds of windows that appear in
Xcode There are windows for browsing the documentation, building your project, debugging your
executable, searching multiple fi les, and so on
PROJECT LAYOUT
Xcode provides three different strategies for organizing your windows and panes, called a layout
style You can change the layout style as often as you like It doesn ’ t have any material effect on the
content or functionality of your project; it just defi nes its visual organization and navigation You
should have a basic understanding of the layout styles offered by Xcode, because they infl uence how
the project window is organized and where information about its content is displayed It also affects
Xcode ’ s use of separate windows for various tasks
Xcode saves your layout preferences — open windows, window position, list order, table columns, and other display options — in a per - user, per - layout preference fi le stored in the project ’ s document The window positions and display options you establish in one layout will be ignored by other layout styles.
Similarly, your view preferences will be independent of those of other users working on the same project (assuming they have a different POSIX account name)
Choosing a Layout
Xcode offers the following three layout styles:
Default All of the project groups and items are in a single browser
shared with a combination details and editor pane Source fi les may be edited here, or in separate windows Build, debug, and other tasks open in separate windows
Condensed The project window contains only the project groups and
items All tasks, including editing, are performed in separate windows There is no details pane
All - In - One The project and most tasks are confi ned to a single window
The Default layout style, which was shown in Figure 3 - 1, is the traditional Xcode windowing style The
project window contains all of the groups and items in a single browser The window shares a split pane
with item detail and editing panes on the right side You can view and edit source fi les immediately in
the right pane, or you can open them in separate windows Build, Debugging, and other tasks appear in
their own window This is a good choice for general development on a moderate - sized screen
The Condensed layout style, shown in Figure 3 4, could also have been named the “ Everything In
-A - Separate - Window ” style The project window contains only the project ’ s group and items The
Trang 5groups are further subdivided by a tab control at the top of the window The tab selects between the source groups, the target groups, and all other types
of smart groups This chapter shows you how you can customize this organization a little later Everything else you work with, or open, appears in a separate window This is a good style for complex projects and for developers with large monitors
The descriptively named All - In - One layout style, shown in Figure 3 - 5, is essentially the opposite of the Condensed style The project, editing, and all tasks (build results, multifi le searches, source control) are contained in a single window You can switch which view you are working with using one of several tab controls The tab control in the upper - left corner
of the window switches the entire window between the project and debugger views While in the project view, another tab control above the right editor pane switches the upper portion of the pane between the Detail, Project Find, SCM Results, and Build Results
This is a good style for developers with small monitors or those who want to avoid the clutter
of having many different windows open It can be particularly useful when you ’ re working with multiple projects at the same time — it ’ s often diffi cult to identify to which project an auxiliary window belongs This problem is explained in more detail in the “ Opening One or More Projects ” section in Chapter 4
FIGURE 3-5
FIGURE 3-4
Trang 624 ❘ CHAPTER 3 XCODE LAYOUT
Despite its name, the All - In - One style does not force everything into a single window You can still
cause selected source fi les to open in separate windows for more convenient editing Additionally,
Info and Quick Help windows are always separate, regardless of the layout style you are using
Changing the Layout
Xcode ’ s layout style is global After you have set it, it applies to all projects that you open To
change Xcode ’ s layout style, choose Xcode ➪ Preferences, and click the General (leftmost) icon at
the top of the window (see Figure 3 - 6)
FIGURE 3-6
The global layout style is selected with the Layout pop - up menu Other options control the behavior
for edit panes, whether projects are automatically reopened when Xcode is launched again, and
whether open windows are restored when a project is reopened
The layout style cannot be changed while there are any open windows that are infl uenced by Xcode ’ s layout style If the Layout option in the preferences window is disabled, close all projects and utility windows until it becomes enabled
The next few sections explain the details of the project window and how the layout styles infl uence
their layout and navigation
GROUPS & FILES
All of the components of your project are represented as icons in the Groups & Files pane of your
project window Icons with a small grey expansion triangle next to them indicate a group of items
Groups contain items and sometimes other groups