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 :
let const = <# placeholder_text/code #>
Have a look at the gif below:
If you enjoyed reading this post, please share and give some clapps so others can find it 👏👏👏👏👏 !!!!
If you have any comment, question, or recommendation, feel free to post them in the comment section below!