iOS Development lazy Tips---customizing Xcode code Snippets

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.