The table below shows key similarities and differences between code completion in Xcode and AppCode:
|Case sensitivity||Case-insensitive by default||Case-sensitive by default||Can be changed in|
|Shortcut||Esc or ⌃Space||⌃Space|
|Jump to next CamelCase using Tab||Supported||Not supported|
There are several additional completion types that can help you code faster. Lear more about them in the Code completion section.
Of course, you can select code with the mouse as usual. AppCode also has several specific code selection mechanisms which you can adopt to edit code faster:
Multiple selections: press ⌃⌥⇧J to select all occurrences of the currently selected text, or select the text and press ⌥J to select its occurrences one by one. Next, you can change them simultaneously. This way you can achieve a behavior similar to Xcode’s Edit all in Scope.
Column selection: press ⇧⌘8 , select several lines, and edit the text as columns. Press ⇧⌘8 to exit this mode.
Structural selection: this allows you to select not text but code, while taking advantage of the code hierarchy. Set your cursor anywhere in the code and press ⌃W / ⌃⇧W .
In Xcode, you can configure code snippets with placeholders for template values. In AppCode, such snippets are called live templates and they allow more interaction, such as scripting the placeholder values, setting default values depending on the context, and more. All the built-in templates can be found in .
In Xcode, you format code with ⌃I (to reindent it), and this works only for the current file. In AppCode you can:
The Reformat code action takes into account many more code style settings than the Auto-indent lines action does, and it can be applied to a specific directory, file, or the whole project.
You can configure specific code style settings separately for each language supported by AppCode in :
To use Dash instead of the bundled browser, enable it inand use the ⇧F1 shortcut.
To generate comment stubs in AppCode, type the beginning of the comment and press ⏎ .
Change Signature can take care of changing the function or method signature everywhere in your code.
Swift refactorings work both in mixed-code projects and in pure Swift code. They can extract methods, closures, and variables:
AppCode’s refactorings, as well as its code generation actions, don’t work with text – they work with code structures to be as accurate as possible. Moreover, global refactorings update all the occurrences in your project.
Code generation actions in AppCode are available via ⌘N . The set of actions is different for Swift and Objective-C:
Code folding in AppCode can be configured in . To fold a code block, use one of the following:
Press ⌃- / ⌃+ to collapse/expand the current code block.
Collapse/expand the code block by clicking the -/+ icons on the gutter.
Press ⌃⌥+ / ⌃⌥- to collapse/expand all the code in your file recursively.
Use ⌃⇧. to fold an
switch, and other control flow statements.
Fix-its, intentions, and inspections
Xcode shows most errors and warnings inline in the code editor. However, the full set of code analysis checks in Xcode, which is available via, requires the project to be built, and works correctly only if the project has been built successfully.
AppCode performs all of its code analysis checks on the fly, and, even better, it does not require you to build the project at all. It integrates all the CLang analyzer checks for Objective-C and all the SourceKit checks for Swift, together with fix-its. In AppCode, these checks are called inspections.
AppCode has inspections for all the languages it supports, not limited to Objective-C, Swift, and C/C++. For Objective-C/C/C++ and Swift, it has separate specific sets of inspections which you can view in:
Each language supported by AppCode can have its own set of inspections. Some plugins, such as Database Tools and SQL, already come bundled with the IDE. For others, all you need to do is to install the plugin for the language, and all inspections for it will become available in . All the inspections from third-party plugins that provide specific code analysis checks such as SwiftLint are also available here.
In addition to inspections that alert you to a problem in your code, AppCode has so-called intentions actions which provide ways to optimize your code:
All intentions in AppCode can be configured in:
The Inspect Code action is AppCode’s replacement for Xcode’s Analyze. In AppCode, this action runs all inspections available for a particular language for the scope you need.
After the check is completed, you can apply the inspection quick-fix to several places at once:
You can run a single inspection by using Run Inspection by Name ⌃⌥⇧I .