6

How can one save / restore user created code snippets in Xcode?

1 Answer 1

14

The user generated code snippets are saved in

~/Library/Developer/Xcode/UserData/CodeSnippets

And you can simply pass them around to save and restore them. I recommend giving them a meaningful name instead of the generated one.

I wrote a short explanation about it here, and also started a collection of useful code snippets that can be shared on github. There are still very little snippets there, so any useful snippets you have to share would be great.

Sign up to request clarification or add additional context in comments.

2 Comments

I do have more code snippets in Xcode, than files in the CodeSnippet folder. Where are the rest saved?
These last 2 code snippets where from the versions folder /.DocumentRevisions-V100. Old versions of changed snippets where shown in Xcode (a bug).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.