iOS tips: Creating custom code snippets in xCode

How to create custom code snippets in xcode? Its super easy.

stocksnap.io

Whenever you find some useful code that you can reuse in xcode, do create a code snippet. Code snippets appear towards the right bottom corner of xcode (under the utilities section).

There are so many pre defined code snippets in xcode. You just have to drag the required snippet to your editor area and use it. Sometimes you may have to edit some variable names and all as per your code. Its very much helpful in programming.

How to create a code snippet in xcode?

Creating a code snippet is easy. Just select the code that you want to make a snippet and drag it to the code snippet section towards the bottom right of the xcode. A window will appear and there you can rename it and add a description. Check the gif below.

Now the code snippet is created. Just drag the code snippet from the snippet section to the editor area . Thats it.

But if you need to create some code placeholders, you can edit the code snippets you just saved and add the code placeholders. Placeholders should be written like :

Have a look at the gif below:

Thats it.!!

Enjoy!!

If you enjoyed reading this post, please share and give some clapps so others can find it πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘ !!!!

You can follow me on Medium for fresh articles. Also, connect with me on LinkedIn. Also follow my facebook page on swift: iosswiftblogger.

If you have any comment, question, or recommendation, feel free to post them in the comment section below!

iOS and tvOS developer, dreamer, photographer 🀨

iOS and tvOS developer, dreamer, photographer 🀨