IOS development-Code Snippets (Code Snippets) improve development efficiency.

Source: Internet
Author: User

IOS development-Code Snippets (Code Snippets) improve development efficiency.

 

Introduction

A new feature introduced in XCode4 is "Code snippet (Code Snippets )". For some frequently used Code, abstract it into a template and put it into Code Snippets. You only need to enter the shortcut key when using it.

 

To view code snippets, see:

You can also use Control + Option + Command + 2 to call up the "code snippet" tool.

 

Apple also comes with some "Code Snippets (Code Snippets)", such as: for Loop:

 

The corresponding "Code snippet (Code Snippets)" template is:

 

 

Custom "Code snippet (Code Snippets )"

The content to be replaced is input in the <# content #> format. If there are multiple replicas, you only need to press Tab to replace the next content.

 

Select the Code to be put into Code Snippets, and drag it to Code Snippets in the lower right corner of Xcode with the left mouse click:

Note: After the code is selected, you need to move the cursor for a while before you can drag the code. A few people have asked me this question, so it is necessary to write it out.

 

After the drag is successful, Xcode will pop up a small window. We can customize the code snippet information we just dragged:

 

When using it, you only need to type hello to automatically complete the Code:

 

 

Manage Code Snippets)"

The code snippet directory managed by Xcode is ~ /Library/Developer/Xcode/UserData/CodeSnippets.

 

Summary

If we can reasonably use "Code Snippets (Code Snippets)", it will greatly improve our work efficiency. Some common Code and reusable Code can be stored in "Code Snippets", which is very easy to use.

 

 

 

Blog Author: GarveyCalvin

Blog Source: http://www.cnblogs.com/GarveyCalvin/

The copyright of this article is shared by the author and the blog. You are welcome to repost it, but you must keep this statement and provide the original article link. Thank you for your cooperation!

 

Related Article

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.