Smart editor

Code completion

AppCode offers two kinds of code completion: basic as-you-type completion, and more advanced SmartType completion (^⇧Space) for more precise filtering of suggestions.

Code completion

Both completion types support CamelHumps and Middle Matching; that is, you can complete any item by entering only its uppercase characters or any part of its name at all.

Read the tutorial to learn more

Imports optimization

With AppCode it’s easy to clean up your entire project from unused imports - just invoke Code | Optimize imports from menu or press ⌥⌘O. All unused or duplicate imports will be highlighted in the editor, making your code cleaner.

Imports optimization

Automatic imports

When you start using a class that is not yet imported, AppCode will suggest adding the corresponding import automatically, or even add the import when you complete code.

Automatic imports

Code formatting

Code formatting works as you type, and can also be invoked implicitly on a selected code fragment, file, or whole directory simply by pressing ⌥⌘L.

You can set up general and language-specific formatting options in Preferences | Editor | Code style. For all code style settings that affect your code AppCode shows live preview, highlighting the line affected by the most recent change.

Code reordering

AppCode lets you quickly change the order of code elements with a few simple shortcuts. For example, you can move blocks of code up or down with ⌘⇧↑/↓, or move lines with ⌥⇧↑/↓.

Advanced formatting options

To keep specific formatting in some selected files, AppCode can auto-detect code style and use existing file indents for editing.

AppCode also allows you to change the settings applicable to the selected piece of code only. Select the code and use the quick-fix Adjust code style settings (⌥Enter)

Advanced formatting options

Multiple carets and selection

With AppCode you can increase your productivity by editing several locations in your file at the same time. Press ⌥⇧ and select the caret locations with the mouse, or press ^G to add the next occurrence of the current word to the selection (to delete from the selection, press ^⇧G). Then, just write code simultaneously in all these positions. Autocompletion and live templates will also work as usual. To restore single caret mode, use Esc.

Multiple carets and selection

Expand/Shrink Code Selection

AppCode has a simple shortcut to easily expand a selection: from a symbol to an expression, from an expression to a line, from a line to a logical block of code, and so on. Just press ⌥↑ as many times as you need. Or, to shrink the selection to a smaller logical part, press ⌥↓.

Expand/Shrink Code Selection

After selecting a block, you can apply a block comment (⌥⌘/) or line comment (⌘/) to it. And if you’d like to comment a single line, you don’t even need to have the line selected — just have the caret on it and press ⌘/.

Quick documentation

With AppCode you can see a method's implementation without navigating to it or leaving your current context. Simply place the caret on the method call and press ⌥Space.

To see the relevant documentation, just press F1. The documentation displays in a pop-up window with clickable links to other resources. As a bonus, quick documentation can even show you a macro substitution or a Swift inferred type.

Quick Definition/Documentation

Parameter Info

If you are ever unsure what exact parameters to pass to a method or function, Parameter Info (⌘P) is there to help. It shows you parameter types and available function signatures.

Parameter Info