Creating your own snippets
You can copy any code you have in your project and drag it over to the snippets library. If you want to add the replacement tokens, you can add blocks like this:
<# replace me #>.
Anatomy of the .codesnippet plist format
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@interface &lt;#Class Name#&gt; ()
Installing 3rd party snippets
Once you've found some snippets you want to try out, using the Xcode Snippets gem is very useful. It allows you to maintain a human readable list of snippet files, but also rename them to the UUID version that Xcode needs.
To start, you should migrate any existing snippets you've created by hand:
Then you can install individual snippets like this:
xcodesnippets install some-cool-thing.codesnippet
The code snippets Xcode uses can be found in
~/Library/Developer/Xcode/UserData/CodeSnippets. The files that the xcodesnippets gem manages can be found in
If you are making tweaks to a snippet, keep in mind that you'll probably have to delete it before re-importing it with the gem.