How developers can take advantage of new features in Apple’s Xcode 8
In September, Apple will release Xcode 8, the IDE the company recommends for building apps for its macOS, iOS, watchOS, and tvOS operating systems. It’s a powerful IDE that’s constantly increasing the stake.
Here’s a look at the upgrades my team is already using.
The first thing you will notice with Xcode 8 is how fast it is. Apple has done incredible engineering to accelerate the base speed of the IDE. Projects load and build faster. Right off the bat it’s a huge improvement for any team. In addition to the under-the-hood improvements, Apple has made a number of smaller but very useful improvements that have long been needed in Xcode.
From day one, Apple’s programming language, Swift, has been a big hit with the developers and my team. This modern language is not chained by decades-old models, as is the case with Objective-C. It’s clear that Apple will eventually eliminate or downgrade Objective-C as Swift continues to woo developers. (Note: Microsoft has taken the same position with C # as Visual Basic.)
The biggest change we’ve noticed with Swift 3.0 is that we need to rewrite the names of all APIs that are called. The change reflects Apple’s desire to make Swift writing easier and move away from traditional Objective-C-based naming conventions. The API naming convention can be found here.
Swift is evolving rapidly. Change requests can be viewed and added to a GitHub project.
A final new feature, for iPads running iOS 10, is the inclusion of a new app, called “Swift Playgrounds”, which teaches you how to develop with Swift. If you have developers or power users on your team who want to learn Swift, Playgrounds is a great place to start.
Apple has made a number of smaller but very useful improvements that have long been needed in Xcode.
Source code extensions
The first major improvement is the addition of source code extensions. Almost all IDEs (like Eclipse) support plugins that developers can create to enhance the basic functionality of the IDE. Xcode introduces its first iterations of plugins with source code extensions to help manage source code more efficiently. It’s a good start for plugins in Xcode.
Code signing relief
We’ve all been there: impossible to build a project because the code signing is not correct. Apple is tackling code signing issues in Xcode 8, which should be a welcome relief for everyone. With new projects, you can select Xcode to handle code signing for you. This means you no longer need to balance certificates, provisioning profiles, and application IDs for each project. What a huge relief!
MacOS, watchOS, tvOS and IoT
The focus for Xcode is increasingly shifting to iOS devices. This makes sense, as Apple gets over 56% of its revenue from iPhones and still gets much of the change from iPads. In addition to iOS development, Xcode supports development for macOS (the new name of OS X – it’s still the same operating system; only the name has changed), web apps, tvOS to power Apple TV and watchOS for Apple watches.
Mobile delivery teams like mine find themselves providing more and more solutions for larger platforms. The potential for providing solutions for tvOS and watchOS is still immature; the technologies are only one year old.
In addition to supporting additional operating systems, Xcode also supports the development of IoT (Internet of Things) solutions. There are basically two parts to any IoT solution: the sensor capturing the data and the hub receiving the data. For now, Xcode does not encode the sensors, but the hub is at the heart of Apple’s IoT strategy. There are actually two types of IoT hub: iPhone / iPad and Apple TV.
IPhone is the default tool for capturing data broadcast from a sensor using Bluetooth LE. The most interesting hub is Apple TV. Unlike a cell phone, Apple TV devices sit next to a TV and are always connected via Wi-Fi to the internet. This offers exciting opportunities to manage IoT sensors in your home or business.
Improvements to Interface Builder
Interface Builder has received a welcome rewrite to support macOS, iOS, tvOS, and watchOS solutions. The main improvements include:
- The ability to see what your app will look like at different resolutions
- UI debugging improvements
- The ability to instantly see how your app will look for side-by-side apps on iPad
Interestingly, Apple suffers from resolution fragmentation. iOS now supports universal applications which must include landscape and portrait displays for iPhone and iPad, which can range from 1136 by 640 pixels for an iPhone 5 to 2048 by 2732 pixels for an iPad Pro. The key to successfully supporting such a range of devices is to take advantage of automatic layout. Updating Interface Builder will make it easier for you to see how your applications will appear on different screens.
Smaller adjustments that help
Aside from the big changes to Xcode 8, there are a number of minor changes that may go unnoticed at first, but can help. They understand:
- San Francisco Mono, now the default font for code editing – much easier to read
- Code completion for images
- The ability to highlight the current row you are working on
- Automatically generated help
The result is that Xcode 8 is a substantial update. As with previous updates, Xcode 8 is free but requires a Mac and must be run with the latest version of macOS.
Xcode 8 is available in the Mac App Store.