Determining the Shortcut for a Code Snippet

Enter source code text with minimum effort by typing a completion shortcut for a code snippet.

bullet
To find the shortcut for a code snippet
  1. In the Code Snippet library, select the snippet for which you want to use a shortcut.

  2. Click Edit.

  3. In the Completion Shortcut field, note the shortcut or add one.

  4. Click Done.

    The screenshot shows a completion shortcut highlighted.

    ../Art/shortcut_2x.png

Code snippets let you quickly enter source code. You can drag a snippet from the Code Snippet library into a source file. Or, for maximum efficiency, type a snippet shortcut in the text of your source code, then press Esc and then Return to enter the snippet. In most cases, when you begin typing the snippet’s completion shortcut, Xcode suggests it, so you need only accept it by pressing Return. Both standard and custom code snippets support completion shortcuts. You can edit the shortcut for a custom snippet.