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.