How to define a Code Snippet in Xcode

I keep forgetting how to create my own Code Snippets for easy use in Xcode projects. It is actually ultra simple:

  1. write some code you’d like to use again
  2. highlight it
  3. drag the highlighted section into the Code Snippets library
  4. that’s it!

Screen Shot 2014-01-08 at 16.18.13

To edit the description of your new snippet, single-click it in the Code Snippets Library pane, and up comes a handy dialogue box. Click edit and amend to your heart’s content.

Screen Shot 2014-01-08 at 16.21.49

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.