How to save time with Xcode snippets

Oleksandr Nikolaichuk ๐Ÿ‡บ๐Ÿ‡ฆ
2 min readApr 25, 2020

--

Photo by Alexandar Todov on Unsplash

Original Post

Do you feel that you are sometimes needed to create the same parts of code? Code snippets can easily help you.

For example, we need to create a Singleton class.

1. Create a code that you want to reuse.

2. Highlight Singleton code and press Editor -> Create Code Snippet.

3. Name it and write a completion shortcut.

You can easily add <# and #> from the start and end of any part of code, and it will create a placeholder part of the snippet. And thatโ€™s it. We are ready to use our shortcut. You can just type singleton_code.

--

--