Rolling your own snippets

So, now it gets much more interesting. You can (and most definitely should) create your own snippets of any code that you use frequently and which involves more than a trivial amount of typing. You can then also assign a keyboard shortcut to your user snippet, which is a lot faster than calling up the Utilities pane and searching and scrolling your way through the whole list.

It's kind of ironic that Xcode's method to create user snippets is to select the code you want to store as a snippet, and then drag the text into the snippets list. Are we not coders? Can we not do this with our keyboards? It would seem the people in Cupertino think not:

  1. So, go ahead: drag some code into the snippets list, and you'll see a ...

Get Mastering macOS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.