How to add/remove custom Code snippets in Xcode 11 and above

Update for Xcode 11

Add code snippet

Same way as before:

  1. Select code
  2. Right click on it
  3. Create Code Snippet

Edit and Delete code snippet

Type cmd + shift + L and you will see the following UI:

enter image description here


For more information about Xcode code snippets check this article.


How to add


In Xcode select line or code to be added in code snippet and then

Option1

  1. Goto Editor

  2. choose the Create code snippet

enter image description here

Option 2

Select Code you want to add to snippet right click and choose create code snippet

How to Remove


Choose any snippet and press backspace enter image description here


How to Edit


If you want to edit already added code snippet it is easy. just open code snippet library list (from right corner) from the list select code snippet you want to edit and press SPACE BAR button

enter image description here

Warning : My Xcode crashes randomly couple of time during removing or adding code snippet make sure you save your work (Xcode 10 BUG) :]

Hope it is helpful

Tags:

Ios

Xcode10