Code snippets are stored in your ~/Library/Developer/Xcode/UserData/CodeSnippets directory. To share your code snippets, simply copy them from this directory. Each code snippet file is a standalone plist file with a universally unique identifier (UUID) as the file name followed by .
If you want to create a new code snippet in Xcode, you just need to select a portion of code, right-click on it and choose the option Create code snippet. Then, you can edit and delete it by pressing cmd + shift + L .
Creating a code snippet is easy. Just select the code that you want to make a snippet and drag it to the code snippet section towards the bottom right of the xcode. A window will appear and there you can rename it and add a description.
I did these steps :
In the Library select the code snippet you want to delete and press Backspace. A confirm dialog will show up, click "Delete".
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.
I was having trouble, and after messing around a bit it finally worked. You select the user snip and hit the delete key. I tried this multiple times but it didn't work initially. This may be due to me running a prerelease version of Xcode though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With