ios-Build Your own code block "improve coding efficiency-xcode code block"

Source: Internet
Author: User

Objective

March 1, 2018 lunar month 14 Thu

I do not know how, early in the morning to work to write a blog;

Xcode code block

Development, do not want to write too much code, and then will use this method, to simplify the code, including the MVVM framework, it is also reflected to simplify the c inside of the garbage code, it is actually written, Xcode itself provides us, improve the writing efficiency of the shortcut-code block, is the following block:

Xcode comes with a code block

Let's take a look at the code block that comes with Xcode, and then click the left mouse button to drag it into the project

After dragging into the project

As you can see, it has helped us to write some of the key code, so we just need to fill in according to their own needs;

Xcode Custom code block

since Xcode provides such a tool, how to customize the code block according to its own needs, we commonly used, such as the property to define strong, assign, copy, week and other types, first with the strong type of example, First paste the following code into a file in the project, then select the left mouse button long press, and then drag into the code block area of Xcode;

@property (Nonatomic,strong) < #Class #> *<#Object#>;

Drag and drop the edit box, you can edit the name and description information, and then click Done;

When you take a code block with Xcode, check the drop-in project

To delete a custom code block

If you want to delete a custom code block, just select it and press the keyboard delete button "Backspace".

ios-Build Your own code block "improve coding efficiency-xcode code block"

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.