Xcode Reuse code snippets in Xcode


Example

You can save your code snippets for use later simply by drag and drop. For eg: if you have an NSLog statement that used for so many places somewhere else in the project, then you can save the NSLog statements to code snippets library.

enter image description here

Drag the NSLog statement to code snippet library.

enter image description here

Now you can simply reuse the code snippet anywhere else on project. Also you can customise the code snippet and can add placeholder texts by give statements bw <# and #>.

enter image description here

Drag and drop this code snippet gives an NSLog with placeholder text.

enter image description here