Three tips to improve your XCode4 skills

Help Xcode 4 help you! Work more efficiently with these tips, focusing more on the code and less on the IDE.

Tip #1
Use separate tabs for different tasks (editing source, editing nibs, debugging, building, etc).

Cmd+T opens a new tab. Each tab will remember its layout, so you can configure it to fit a certain task.
e.g.: My ‘Debug’ tab has the Debug area open, the Debug Navigator shown, both resized to take up much of the window.

Tip #2
Switch to tabs automatically by using Behaviors and naming your tabs.

First, double click on a tab to give it a custom name. Then go to ‘Xcode -> Preferences -> Behaviors’, select a behavior and fill its ‘Show tab named’ option with your custom tab’s name. e.g.: Configure the ‘Running Starts’ behavior to open the ‘Debug’ tab.

You can even create custom behaviors triggered by a keyboard shortcut.

Tip #3
Use Code Snippets to quickly type many common pieces of code.

If you have some code that you find yourself typing over and over you can convert it to a snippet and let Xcode autocomplete it for you. Select the desired text, and drag it into the ‘Code Snippets Library’ in the Utilities pane.

Next, click on the ‘Edit’ button, give it a title and a completion shortcut. Check that the platform and scope settings are adequate. Here’s an example of a simple code snippet.

Image not found

Less fiddling with the UI means I can focus on the task at hand, instead of wasting time re-configuring the IDE’s layout every few minutes. Text replacement allows me to reduce the time I focus on typing bolierplate code, which distracts from creating the ‘real’ code. Less distractions means better concentration on my current task.

Three Tips is part of a new series on Techblog where we’ve asked members of our team to share some of their best secrets.

Restored from Internet Archive · Capture: Sat, 19 Sep 2015 19:41:54 GMT