How ??? I can not delete a custom code snippet in Xcode.
-
stackoverflow.com/questions/887404/…Marek Sebera– Marek Sebera2011-05-07 19:32:34 +00:00Commented May 7, 2011 at 19:32
-
stackoverflow.com/questions/5265448/…Marek Sebera– Marek Sebera2011-05-07 19:32:55 +00:00Commented May 7, 2011 at 19:32
-
and how to add them in the first place?Anonymous White– Anonymous White2012-10-25 02:32:12 +00:00Commented Oct 25, 2012 at 2:32
8 Answers
I did these steps :
- Select needed code snippet and press Delete key.
- A pop-up window will appear , and select Delete button.
- Remember that : this action cannot be undone.
4 Comments
Good question, I haven't found a way to do it from within Xcode, but they can be deleted from the Finder. The snippets are stored at ~/Library/Developer/Xcode/UserData/CodeSnippets/. Each one is a separate file that you can delete. Unfortunately they're named with an ID and don't give an indication of which one is which. They're XML files though, so either use a text editor or QuickLook to see the contents and recognise them.
Also, I've had to restart Xcode in order to get the deleted snippets to no longer show up.
Comments
User-created code snippets are located in
~/Library/Developer/Xcode/UserData/CodeSnippets.
If your XCode UI for deletings snippets doesn't work as in my Xcode 10.2.1, you can navigate to this folder and
either delete all user snippets with rm * or use some kind of cat/grep to find the ones you want to delete.