1

I have multiple code snippets i found here and i want to import all of them at once into xcode but it does not work. When i try to import even just one code snippet from drag and drop from chrome to xcode it imports the url for the snippet instead of the content.

the end goal is to have my entire team share these snippets. enter image description here

2 Answers 2

1

I found one way to do this. It seems the code snippet files are plist files generated by xCode IDE. So from the github hosting the .m files here we can drag and drop into the xcode editor. Highlight the text and drag it into the xcode snippet editor. Xcode will then generate the plist file associated with each snippet you dragged in. How to get to these snippets so we can create a repo that your team can share ? this is how:

  1. From your terminal shell traverse to ~/Library/Developer/Xcode/UserData

1b. create a git repo of the folder CodeSnippets and call it CodeSnippets

  1. If there is already an existing folder called CodeSnippets then rename it to CodeSnippets_old

    3.clone the repo you made in 1b.

    note: might have to restart xcode to see the snippets appear.

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

Comments

0

There is a very cool app that I believe to be the answer to your problem:

http://cocoaholic.com/snippet_edit/

1 Comment

how does it import files directly ? it seems to be more suited to grouping the snippets I was looking for way to import them by simply dragging. I guess someone would have to supply a plist for each one in order to import.

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.