Good articles to my personal technology blog: https://cainluo.github.io/15098681423885.html


There’s a lot to say, so I’m going to break it down and hopefully cover it all in canto II.

If you missed the first article, check out iOS Development: Xcode 9 (1), a new feature for iOS 11.

Reprint statement: if you need to reprint this article, please contact the author, and indicate the source, and can not modify this article without authorization.


The default newline character

In Xcode 9, we add a newline character by default, so we don’t forget a trailing newline character, but the downside is that we can’t delete the last newline character, Xcode 9 automatically adds a ~ every time we type something

Soy sauce is also very convenient


Integration making

In addition to the above, Xcode 9 also integrates with GitHub so that we can easily use it to integrate and manage third-party libraries:

To Clone a third party library, we can find it on GitHub by clicking the Clone option on Xcode 9’s menu bar Source Control:

Here, we select Alamofire, and when Clone is complete, we can see the third-party library code:

If we want to see the version status of the third party library, and the historical submission record, we can use Command + 2 or click, if we want to see more information, we can press option + left mouse button on the version number, and then we can see more information:

We can also search for some information by typing Changelog. We can search through the ALL drop-down menu and select Message, Author, or Revision:


Commit to branch

We can also select a branch and submit it to GitHub. First we get a branch from master:

Then make some random changes:

Then go to the Commit option in Source Control:

Then here we can see what has been modified and forgotten to fill in our remarks:

Finally, merge the branch to master, but in this case, we’ll just demo it, not actually commit it:


Breakpoint debugging

In Xcode 9, breakpoint debugging can be done in another way. Now we can add LLDB commands directly to breakpoints:

That way, when we’re writing code, we don’t have to write an NSLog as often.

Search breakpoint debugging

In addition to adding LLDB commands to breakpoints, we can also search to retrieve these commands:

This way we can search through a large number of commands for the command we want

Physical folder

In Xcode 9, we finally added physical folders. When we add/remove folders in a project, we can finally add/remove the corresponding physical folders as well. I won’t show you here, but you can do it yourself

View the Debug

There are also some improvements in the View Debugger in Xcode 9. We can click Debug View Hierarchy to enter the View Debug mode:

In addition, we can see more details through the small window on the right.

Runtime problem detection

As we all know, two kinds of detection were added in Xcode 8 :Address Sanitizer and Thread Sanitizer, and another Undefined Behavior Sanitizer was added in Xcode 9.

Undefined Behavior Sanitizer can be used to detect various problems in C-based language, such as the detection of the main thread. This ensures that there are no child threads that perform UI updates on background threads. Since the overhead of the main thread inspector is negligible, it is turned on by default.

How to do that, I won’t show you here, but you can update the UI in the child thread with GCD and see what happens.

Other Updates

In addition, Xcode 9 also brings an improved emulator that simulates real machine keystrokes (something that seems to have existed in emulators for years).

In addition, different simulators can be opened to facilitate our adaptation in various models and support multi-direction.

Xcode 9 integrates with GitHub, but it also integrates with Xcode Server. You can directly integrate all kinds of robots in Xcode without having to use Xcode Server alone. You can open it and follow the instructions:

Although I don’t know what can be used for, if there are children who know, can teach me ~~

Wireless Build to your phone, as long as your computer and your phone are in the same WiFi:

One limitation is that you have to be running iOS 11 or above, other systems are useless.


conclusion

Finally, Xcode 9’s new build system written in Swift is swift-friendly, it improves performance, and it can catch all sorts of painful configuration issues that the current build system can’t, but it’s only optional for now, but in the future, this should be on the Xcode default check list.

If we were to choose a new build system we could set it like this:

That’s it for Xcode 9. If you don’t know anything about Xcode 9, you can go to the official website for a walk

Here’s the official source:

  • Session 404: Debugging with Xcode 9 apple.co/2wlqhOH
  • Session 401: Localizing with Xcode 9 apple.co/2uynlMw
  • Session 406: Finding Bugs Using Xcode Runtime Tools apple.co/2wllzk5
  • Session 405: GitHub and the New Source Control Workflows in Xcode 9 apple.co/2ufYWMk

The project address

The address of the project: https://github.com/CainRun/iOS-11-Characteristic/tree/master/1.Xcode%209


The last