IOS-build your own code block [improve coding efficiency-Xcode code block], ios-xcode

Source: Internet
Author: User

IOS-build your own code block [improve coding efficiency-Xcode code block], ios-xcode
Preface

Thursday

Somehow, I want to write a blog early in the morning;

Xcode code block

During development, I don't want to write too much code. Then I will use this method to simplify the Code, including the MVVM framework, which also reflects the garbage code in C; in fact, Xcode itself provides us with a shortcut to improve writing efficiency-code block, which is the following:

Xcode built-in code block

Next, let's take a look at a code block that comes with Xcode, and drag it to the project with the left mouse button.

After being dragged to the project

As you can see, it has helped us to write some key code, so we only need to fill in according to our own needs;

Xcode custom code block

Since Xcode provides such a tool, how can we customize code blocks based on our own needs? We are generally used to define strong, assign, copy, week and other types with property; first, use the strong type as an example. First, paste the following code into a file of the Project. Then, select it, press it with the left mouse button, and drag it into the code block area that comes with Xcode;

@ Property (nonatomic, strong) <# Class #>* <# object #>;

The edit box is displayed. You can edit the name, description, and other information, and then click Done;

Same as the code block that comes with Xcode, drag it into the project

Delete a custom code block

If you want to delete a custom code block, you only need to select it and press the delete key [Backspace] on the keyboard.

 

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.