AppCode 2020.3 Help

Documenting code

In AppCode, you can create and view documentation for your Swift and Objective-C code. For Objective-C, you can add HeaderDoc, Doxygen, and appledoc comments and generate full-fledged documentation in various formats using corresponding tools. For Swift, the Markdown syntax is available for code documentation formatting.

Generate comments

Place the caret before the declaration of a method or function that you want to document and do the following:

  • For Objective-C: depending on the comment style you want to use, type ///, //!, /**, or /*! and press :

    Create Objective-C comments

  • For Swift: type /// and press .

    Create Swift comments

View documentation

  • Place the caret at the symbol you want to view documentation for and press ⌃Q. If the symbol is supplied with proper documentation comments or SDK documentation, the Quick Documentation popup appears:

    Quick documentation popup

  • If you want documentation to be shown in a tool window, press ⌃Q twice. Press ⌃Q twice to switch between the popup and tool window modes.

  • If you want documentation to be shown on mouse hover, select the Show quick documentation on mouse move checkbox in Preferences | Editor | General.

Reliable rename

While renaming a function or its parameters, the documentation comments need to be updated accordingly. In case of the Rename refactoring ⇧F6, AppCode updates documentation comments along with other references.

Rename comments

Typing assistance

Basic typing assistance for documentation comments is provisioned by AppCode auto-complete feature:

Autocomplete comments

Last modified: 09 March 2021