不会开机的男孩

Code Snippets

| Comments

Recently I found a fascinated feature of Xcode is the Code Snippets feature. It allows you to just type few characters instead of requiring you retype them over and over.

In my opinion, this is feature is not very obvious. The snippets library is fairly well hidden. Luckily, I’ve found it. There’s no sort of + button or something on the bottom of IDE. Apple just add a gesture to it. The only way you add a new snippet is to write a chunk of code and drag it into the Code Snippet Library window, and then it creates a default snippet and you can modify it, do whatever you want.

add dynamic fields

<#something...#>

Finally I also found the same feature of Netbeans. It’s called Code Templates. and this feature is much easier to use than xcode.

add dynamic fields

${something...}

It’s really fascinated feature and avoid retype the same piece of code again and again.

Comments