Xcode provides an area to save snippet code for later using. Press Control + Option + Command + 2
to show
Code Snippet Library (right-lower corner).
Xcode saves its snippets code at location:
~/Library/Developer/Xcode/UserData/CodeSnippets/
or
/Users/username/Library/Developer/Xcode/UserData/CodeSnippets
Swift snippet name starts with 'sswift-' Objective-C snippet name starts with 'sobjc-'