What’s New in Xcode 9

With everything you need to create amazing apps for Apple platforms, Xcode 9 is unbelievably quick and consistently smooth while editing even the largest files. It also understands your code better than ever, so you can select and edit the structure or even transform the selection directly in the editor. Powerful new refactoring tasks happen in place, renaming symbols across Swift, Objective-C, and even user interface files without skipping a beat. And with source compatibility in Swift 4, Xcode 9 uses the same compiler to build existing Swift 3 code and updated Swift 4 code, so you can migrate at your own pace.

All New Editor

The source code editor has been completely rebuilt for amazing speed. It scrolls at a constantly smooth rate, no matter the files size. And it looks better, too, with preferences that give you greater control over line spacing, multiple font styles, and even the type of cursor. The new command-click gesture makes it easy to visualize and select sections of code based on structure. Issues have been redesigned to flow nicely with your code with Fix-its are grouped together so you can commit multiple changes in a single click.

In Markdown files, headings, bold and italic text, links, and other formatting are instantly rendered in the editor as you type. The Jump Bar even understands Markdown structure so you can quickly navigate your README.md and documentation files.

Refactor and Transform

The new editor goes beyond text entry with a new built-in refactoring and transformation engine. When you select a symbol or block of code, the editor will offer powerful operations such as ‘Extract’ or ‘Rename.’ Xcode will then update your code structure directly in the editor, keeping you focused on the code you're working on. Xcode 9 supports the following transformations and refactorings:

  • Add missing protocol requirements
  • Generate missing implementation stubs
  • Add missing overrides for abstract methods
  • Extract to local variable
  • Extract method / expression
  • Expand default in switch statements to generate all applicable cases
  • Convert if/else to / from switch statement
  • Wrap string in NSLocalizedString macro

This is just the beginning. Xcode’s local transformation engine will be open source as part of the Clang compiler project.

Source Control and GitHub

Xcode 9 makes working with source control – and with GitHub – easier and more tightly integrated. With your GitHub account built into Xcode, the clone window shows all of your personal GitHub repositories, as well as all the repositories where you added a star. From this window, you can search all of GitHub and check out a project with just a click.

Support for Git is now front and center with a brand new source control navigator. Quickly view each of your branches, tags, and remotes with a timeline of commits. Inspect an entry to see all affected files or double-click on a commit to see everything that changed. Common operations, such as creating and merging branches, are quickly accessible in the navigator.

Swift 4

The Swift.org open source community led by Apple has helped Swift build quickly, while producing faster applications and smaller executables. The new Swift 4 compiler now understands Swift 3 code. You can easily move to Xcode 9 right away, choose which parts of your application are ready to move to Swift 4, and migrate the rest of your code later. The language also features an enhanced String type.

Learn more about Swift 4

Cut the Cord

Choose any of your iOS or tvOS devices on the local network to install, run, and debug your apps – without a USB cord plugged into your Mac. Simply click the ‘Connect via Network’ checkbox the first time you use a new iOS device, and that device will be available over the network from that point forward. Wireless development also works in other apps, including Instruments, Accessibility Inspector, Quicktime Player, and Console.

Simulate and Test

The new Simulator app is dramatically upgraded with faster launch times and a new look – the window now appears just like the device you are simulating. Buttons in the device work as expected, and you can even simulate gestures from the screen edge. Touch Bar support means quick actions, such as rotate, are only a tap away.

You can run multiple instances of Simulator to speed up tests by running them in parallel, or test apps that coordinate tasks such as syncing to iCloud across multiple devices. Easily launch Simulator from the command-line, even when driving multiple instances — perfect for automated testing. And Xcode Server is simpler to set up on all of your Macs, as it's now built into Xcode and no longer requires a separate macOS Server app. It’s never been easier to continuously build and test your apps.

50X Faster Search

Faster Everywhere

A brand new indexing engine runs as part of the build process, so Xcode understands your code automatically. Tasks that use the index, such as Open Quickly, are dramatically faster. Searching large projects feels impossibly quick – up to 50 times faster. And a new build system dramatically lowers the overhead of tasks that coordinate the compiler, linker, and other tools.