There is a good saying, smart programmers know "lazy" to improve the efficiency of development. In our daily development, there are some code snippets that will often be used, and you may think that defining some macros can solve the problem, but encountering , for example, UITableView protocol methods, or write a demo when you want to quickly define a UIButton (except, of course, you use storyboard)?
OK, let's start with what is a code snippet?
We enter if in Xcode, select IfElse and enter, appear
This is the system to our already defined code snippet, can quickly complete the code snippet we want to greatly improve the programmer's programming efficiency, we have to do is to achieve this effect.
The steps are actually very simple, using the UITableView protocol method for example.
Remember!< #你想要给的参数名提示 #> is the key.
Finally,the code snippet in Xcode is placed by default under ~/library/developer/xcode/userdata/codesnippets, and can be copied directly to others, sharing resources.
In addition, we can define a lot of other commonly used code snippets, much better than the definition of macros. For example, a single case .... Property..... Let's try it out for ourselves.
@ reprint Please specify, iOS realm @ Confused small book, thank you!
iOS Development lazy Tips---customizing Xcode code Snippets