Xcode keyboard tricks
I’m mostly a keyboard navigation type of user, so it’s been a few busy months trying to remember all of the different little tricks in Xcode while doing Objective-C work.
A few of my favorites:
- ⌘ + l (lowercase L) – if done within a text editor pane, it will re-center the editor around the line that the cursor is currently in. Too confusing? Try this video demonstration from Todd Ditchendorf then.
- ⌘ + option + up arrow – switches between header (.h) and implementation (.m) files.
- ⌘ + b – builds project.
- ⌘ + r – build and run project.
- If you hold down the alt/option key, and then double click on a code token, such as a class name or function name, it will automatically search the documentation for that particular word. Very useful when you want to read some more about the UITableView class, for instance.
- A similar trick is available if you would like to open the definition for a particular code token, such as the source code file where class ExampleController is defined. Just hold down the command key (⌘), and double click the word.