Using the Assistant Editor
As you work with Xcode projects, you will quickly realize that most program functionality comes from editing one of two related files: an implementation file (.m extension) and an interface file (.h extension). You’ll also learn that when you make changes to one of these two files, you’ll often need to make changes to the other. You will see a similar pattern emerge when you start editing GUIs in Xcode.
Xcode simplifies this back-and-forth editing with the Assistant Editor mode. The Assistant Editor (or just called Assistant in Apple documentation) automatically looks at the file you have opened for editing and opens, right beside it (or under it, if you prefer), the related file that you also need to work on, as shown in Figure 6.17.
To switch between Standard and Assistant Editor modes, you use the first and second buttons, respectively, in the Editor section of the Xcode toolbar.
FIGURE 6.17 Xcode opens the file related to what you are working on.
Choosing the Assistant File
When you are using the Assistant Editor, it sometimes chooses a file that it thinks you want to edit but that really is not what you had in mind. To view all the Assistant’s recommended options, click the Assistant Editor icon (a little suit and bowtie) displayed in the jump bar located at the top of the Assistant Editor view. This displays a menu of all the related files that the Assistant Editor has identified, sorted by type, as shown in Figure 6.18.
Changing the Assistant Editor Layout
As you can see, the Assistant Editor occupies more than a little bit of screen space. If you are coding on a MacBook Air (which I love), you’ll find that you need to hide the Navigator/Utility areas to make the full Assistant Editor work.
To change how the Assistant Editor displays in the Xcode interface, choose View, Assistant Editor, as shown in Figure 6.19. From there, you can choose how the Assistant Editor is added to the display and what will happen if multiple Assistant Editors are in use.
FIGURE 6.18 Choose a different file to edit.
FIGURE 6.19 Configure how the Assistant Editors will appear in the display.