Information Technology Reference
In-Depth Information
Chapter 9:Saving Time in
Xcode
In This Chapter
Using code folding
Editing structure
Refactoring code
Using code snippets
Many editing operations are repetitive, while others can help you organize your code more effectively to simplify
development and maintenance. Xcode 4 includes features that can automate many of these operations, saving
you time and effort. The key features include the following:
Code folding
Structure editing
Refactoring
Code snippets
Jumping to a definition
Using Code Folding
Code folding is a simple feature that can hide code while it isn't being edited. It's a display-only feature that
makes it easier for you to concentrate on one section of code without being distracted by surrounding elements.
CAUTION
It's easy to activate code folding by accident. If you're not familiar with this feature, you'll wonder why most of
your code has disappeared and whether you deleted it by accident. It's important to understand how code folding
works, even if you never use it. The code folding gutter described below is very thin, and it's adjacent to the gutter
used for debugging. It's easy to select one when you're trying to select the other.
To fold a section of code, hover the mouse cursor in the gutter at the left of the editor, as shown in Figure 9.1.
The selected code is highlighted with a white background, and the surrounding code is grayed out, as shown.
FIGURE 9.1
Selecting a block of code to hide. Code within the nearest matching curly brackets is highlighted and selected auto-
matically.
 
Search WWH ::




Custom Search