New Changes in XCode9 and XCode9

Source: Internet
Author: User

New Changes in XCode9 and XCode9

XCode9 has been released with the release of ios11. What are the changes in this XCode9 version?

1. Collapse code

The focus is on the Method Name of the method implementation body. Press the comman key, and the entire function will be framed to mark the start and end points of the method.

Click to display the menu

In the menu, there is a Fold that can be used to Fold the method.Folding now has an animation effect

Click

Common refactoring methods have been integrated into the context menu. It can be seen that XCode9 has increased support for refactoring, making it easier and faster to refactor the code in the future.

Before XCode9, press CMD + and click Jump to Definition on the variable or method. However, this menu is displayed. For the Definition of Jump to the variable, it's just one more step. It may be inconvenient to start.

If you want to directly jump to the variable definition, it is now control + command + Click

Of course, if you still think that the previous cmd + Click to jump to the variable definition, you are more comfortable with

Changed to the previous behavior

2. Warning

We define a block without parameters, which is usually the following method:

1 typedefvoid (^UpdateSwichBtnBlock)();

A warning is prompted in xcode9.

 

12 This block declaration is not a prototypeInsert ‘void'

The solution can be as follows:

1 typedefvoid (^UpdateSwichBtnBlock)(void);

However, many third parties have to change the scope, which is too large. At present, it may not be suitable, although this is a trend.

Or, you can use

 

1234 #pragma clang diagnostic push#pragma clang diagnostic ignored "-Wstrict-prototypes"typedefvoid (^UpdateSwichBtnBlock)();#pragma clang diagnostic pop

Completely solves all such warnings temporarily

In Project Settings

If it is set to NO, these warnings will disappear.

However, this is not a good habit. It is just a temporary warning.

3. refactoring

Rename a method or variable, click CMD + on the method, and select rename from the menu that appears.

As you can see, it will collapse all the changes that will occur during rename, so that you have more concepts and influences and are more intuitive!

4 cmd +/-You can adjust the font size of the editor.

It will be useful when presenting a PPT.

5. Greatly enhanced Source Control

The built-in git system of XCode is very powerful, and you can discard the third party in the future.

Github account supported

XCode-Preferences-Accouts can log on to your GitHub account.

After logging on, use the Xcode menu

The clone at the bottom of Source Control can clone the project on your github. Is it very convenient?

The search box is also provided. If you have a lot of projects on github, It is very convenient to locate them.

Open any git project,

A new Show the Source COntrol navigator column is provided.

The relevant information about your branch is listed here, so that you can easily switch the branch and wait for git operations.

In the edit box on the right, you can see the top row

ALL, Last 24 hours, Last 7 Days, Last 30 Days

, There is also a Filter box that can be easily used to locate the submission records we need to find.

Double-click any submitted record,

You can see the details of this change.

Powerful support is also provided for the commonly used git merge tag.

Third-party git clients, such as the Tower he Source Tree, will be abandoned in minutes.

6. New build system

This new build system is still only Preview, which is written in swift only. It is said that it has greatly improved the compilation speed, but it has not become the default, apple said that it will become the default Build in the near future. For more information, see Apple's official document xcode_9.html.

Here is a New Build System (Preview)

7 crash can be seen directly on the local machine

Of course, this requires the user's permission on the machine, and you have allowed it when submitting it to the appstore.

8. runtime Detection

In 8, Address Scanitizer and Thread Scanitizer are included. In Xcode9, Undefiner Behavior Scanitizer is added, which can detect a series of problems in real time. however, we can clearly see that the Main Thread Checker ensures that you have not written the UI update code in a non-Main Thread at runtime.

For example

It can be seen that the Fabric source code is still very powerful. Although we do not have the Fabric source code, the [UIApplicationsharedApplication]. statusBarOrientation] is still detected.

Of course, if you want to disable it, You can operate it in scheme editor.

9 The simulator can be enabled more and the simulator can be logged on

Not only that, but now the simulator can also log on to your appid. In this way, it is very convenient to synchronize information such as contacts to the simulator. In the past, we had to test the contact-related functions, it's much easier to create one by one.

In addition, if Photo Share is enabled, you should be able to synchronize photos in the simulator. It is time to import images one by one.

The simulator can adjust the size at will now. I have to say this function is so cool.

After logging on to appid, Files will be available and you can browse the content in your iCloud Drive. It will become super convenient for users who want to share Files to the simulator.

The appearance style of the simulator has also returned. It is the appearance of the iPhone. It may have been because the simulator cannot be adjusted at will.

Of course, you can remove the appearance skin. In the simulator Window show Device Bezels, remove the option as before.

10 Wireless Development

This is a simple machine that only supports ios11, as long as the support is enabled on the Device.

11 synchronization between Folder and Group

Previously, in XCode, we changed the Folder name. The name of the Folder corresponding to the project in the FInder does not change synchronously, which makes it very inconvenient to rename the Folder, remove it from XCode first, rename it in Finder, and add it back to Xcode.

Now, in Xcode9, the name Folder is re-defined, and the Finder is also synchronized.

We recommend that you create a virtual group instead of creating a real directory in the corresponding folder. Of course, this may be required or not required. in 9, the default behavior has changed. the actual folder will be created. if you want to create a virtual group as before, you need to select New Group without Folder.

You may be worried about whether the group is virtual or practical.

Don't worry, Apple gives a logo to distinguish, and there is a small triangle in the lower left corner of the virtual

When you move a Group (the virtual reality is the same), it synchronously moves the corresponding real folder to the corresponding location, this greatly facilitates the later adjustment of the directory structure of the project. It is painful to adjust the directory structure before. After being adjusted in the project, the structure of the project cannot match the actual folder, this will not happen in the future

Here we found a file synchronization bug in XCode9.

The project we created is as follows:

Xuni is a virtual directory.

At this time, if we move the entire xuni to Views,

As you can see, there is a problem with xcode. Originally, I just moved xuni to Views, but now View1 is moving, causing SecondView to disappear ....

We hope Apple can solve this problem in the next version.

In fact, from the above perspective, creating the actual directory is even more difficult. Maybe this is why Apple changed the default behavior of the New Group to creating the corresponding actual folder.

Infrequent updates

Server & Bots

Now XCode has a built-in XCode Serever for continuous integration. Because it is rarely used, it will not be expanded.

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.