Skip to content

My collection of useful Xcode code snippets! It has been a great time-saver for me so I decided to share it with everyone :)

Notifications You must be signed in to change notification settings

hlung/Xcode-Snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xcode Snippets

My collection of useful Xcode code snippets! It has been a great time-saver for me so I decided to share it with everyone :)

How to use

  • Go to your Xcode user's code snippets directory. Create one if it doesn't exist. open ~/Library/Developer/Xcode/UserData/CodeSnippets
  • In that folder, you can either:
    • run git init, then git pull https://github.com/hlung/Xcode-Snippets to that folder (recommended, easy update), OR...
    • download ZIP of this repo, extract .codesnippet files to that folder
  • Restart Xcode.
  • Enjoy!

Note: Each code snippet has a unique IDECodeSnippetIdentifier key, which Xcode generates when I created each snippet. There's a small chance that they will collide with your existing snippets. Fingers crossed.

Creating your own Snippets

In Xcode, open a workspace and toggle the right sidebar to be visible. On the bottom, there is a panel with four icons in the header. Click on the { } icon to open the Code Snippets Library.

Highlight your code block and drag it to the Code Snippet panel. Make sure to match the suggested platform, language, and completion scope.

License

WTFPL

About

My collection of useful Xcode code snippets! It has been a great time-saver for me so I decided to share it with everyone :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published