The biggest news at this year's WWDC centred on Apple’s smallest product – the Apple Watch. It was far too soon to announce a new model (and in the Tim Cook era, WWDC has moved away from being a forum for hardware launches) but that didn’t stop Apple announcing a new operating system for its first wearable, watchOS 2, which will arrive on wrists this autumn.
You'll also like: Complete guide to Apple Watch and WatchOS 2
What's new in watchOS 2 - and what can developers do with it
watchOS 2 opens up more of the hardware’s core functions, allowing developers to shift greater responsibility for an app’s ‘intelligence’ from the iPhone to which it’s tethered, to the Watch itself. That effectively turns the Watch into a fully-fledged wrist-worn computer that can perform a wide range of tasks on its own before it next connects to the iPhone by Bluetooth.
watchOS 2 gives developers access to core components like the Digital Crown and microphone. That means you could write an audio note-taking application, which would store all of the user’s memos while away from the iPhone and only offloads them the next time it connects. At the same time, because watchOS 2 opens up the internal audio system, you can allow those same users to play back their memos right away, or have them played to a schedule when the memoed tasks were due.
The update to watchOS was one of the biggest announcements at WWDC 2015.
Additional Complications - access to elements of the Watch face
ClockKit, which is new in the latest edition of Xcode, lets you target the Watch face itself with something Apple calls Complications. These are additional readouts that sit alongside the dial to and show information from apps installed on, or syncing to, the Watch. When you code a complication into your app, your users won’t have to switch to it to see notifications and updates.
Volkswagen’s Car-Net app not only lets users lock their vehicle remotely and locate it when they’ve forgotten where they’ve parked, but it also monitors the charging status of the electronic e-Golf and shows the battery level as a Complication that takes the form of a VW logo with a circular bar at the edge that gets closer to completion as the battery charges. Turning the Digital Crown to roll forwards or backwards moves the bar to no longer show the actual charge but the anticipated charge at the selected time, so you’ll know whether you have sufficient power to complete a planned journey.
(If you’re wondering why Apple would choose such an intimidating name as ‘Complications’ for these nuggets of information, it’s actually a standard watch-making term that’s been used for centuries to describe the extra dials on a regular clock face that are used to show non-core timekeeping information, such as the date or phases of the moon.)
Volkswagen’s Car Net system is coming to the Apple Watch, and includes a Complication that shows your available charge on the watch face screen.
Incentives to code for watchOS
It’s no exaggeration to say that opening up these extra features is big news for developers, on a similar scale to Apple’s decision to ship an SDK (Software Development Kit) for the iPhone when it relented on its web app-only approach with the roll out of the iPhone 3.
It makes the Watch a more tempting platform to work with – particularly as competition within that app market isn’t yet so fierce as it is for iOS and OS X.
So, where should you be looking if you want to get a head start on the road to writing Watch apps yourself?
Developing with Xcode
Xcode is the go-to development suite for watchOS, iOS and OS. The latest stable release is free to download from the Mac App Store. Developers can get their hands on the beta release of the next edition here. You can join them if you sign up to the Apple Developer Program, which is free and requires an Apple ID.
Since version 6, Xcode has supported Swift but only the beta release of Xcode 7 so far supports Swift 2.
As well as helping you to design layouts visually and write the code that underpins them, Xcode will check your work for errors and compile it into executable runtimes that you can distribute yourself or sell through the App Store or Mac App Store.
Xcode is Apple’s development environment for working on iOS, OS X and watchOS applications.
How to learn Swift
Apple introduced Swift at WWDC 2014 as the replacement for Objective-C, which until then was the base language for developing iOS and OS X applications. This year, as well as extending its feature set with the unveiling of Swift 2, it made the language open source and announced forthcoming support for Linux.
The best introduction to Swift is Apple’s own documentation.
It assumes no prior knowledge of the language and although familiarity with variants of C would help, it’s by no means a requirement. Simple steps individually introduce key features of the language – such as constants and variables – so you can break off and pick up as required. That makes it much easier to brush up your skills in spare moment while working around a regular job.
It’s not always convenient to switch between a browser window and your coding environment, though (and you won't always have internet access) so we'd also recommend downloading Apple’s free 521 page book, The Swift Programming Language, from iBooks. The most recent revision is available as a pre-release edition that’s been updated for Swift 2.
Apple is focusing on Swift for ongoing application development, introducing Linux support and making the language open source.
Web tutorials for Swift
The best way to learn a new skill is often to see how others are using it themselves. Learn Swift Tips maintains a large, curated collection of links to online Swift tutorials and how-to advice broken down by ability. It caters for everyone from absolute beginners to advanced developers and, beyond these, there are further links to books, code libraries and examples that not only save time but also show the code in use.
A curated list of online resources, such as the one maintained by Learn Swift Tips can be a shortcut to some of the best free learning options.
We’ve recommended Rob Percival’s Udemy course on working with Swift before, and he’s now produced a companion programme entitled Complete Apple Watch Developer Course. To date, the £30 course has attracted close to 14,300 subscribers and earned a five-star rating on the back of 425 reviews. The 143 lectures that make it up run for a total of 18 hours and you don't need any programming experience to get started.
The best approach to writing your first app, if you don’t already have experience of coding for the iPhone or Mac, is to take it slow and steady. Small steps in the early days will help you to consolidate what you’re learning, and starting with a modest personal project, rather than something you plan on selling, is usually the best way to hone your skills without becoming disheartened if you find the work overwhelming.