WatchKit Swift Tutorial - Download Xcode 6.2 Beta and Start Making Apple Watch Apps
/The first beta of the WatchKit SDK was launched this past week and developers can now start making apps.
There are some limitations, but Apple released a lot more than was expected for WatchKit. There's a lot you'll be able to do within the restrictions, which are related to the embedded hardware (i.e.: Apple Watch) and it's battery life.
For now, until Native Apple Watch support is added sometime next year (fingers crossed), you'll have to work within the provided mechanisms. If something doesn't work, you'll need to let Apple know by submitting bug reports, feature requests, or enhancements to WatchKit or Xcode.
Known Limitations of WatchKit in Xcode 6.2 Beta
- Updated: (Beta 2 allows Watch apps to trigger iPhone apps) You cannot press a button on Apple Watch to cause an action in your iPhone app.
- You cannot create or use gestures. All gestures are controlled by Apple.
- You cannot move objects around screen by CGPoint position (Maybe with tableview hide/show).
- You cannot add UI elements at run-time, everything is design time before app runs.
- You cannot make fluid 2D/3D games like Flappy birds (Maybe jittery gameplay with image animations + hiding/showing hackery, + borderless button).
- Animations are image-based (in Apple's sample they include 360 images to show a full circle progress bar = 2mb image data).
- Your code runs on your iPhone app in an extension (new in iOS 8), and your UI + images reside on the Apple Watch.
- Your app will stop if the Apple Watch and iPhone are separated beyond the range of bluetooth. Only Apple can run native apps on device.
- You can only use storyboard files for UI (no .xib files).
- You must create an iPhone app Xcode project and add Apple Watch targets to create an app.
- You cannot use a physical iPhone with the Apple Watch simulator. Only available in simulation on Mac.
With some of the limitations in perspective, you can design apps that provide meaningful information that compliment your iPhone app. The watch is intended to show information that can be used quickly, and it isn't designed as a gaming device because of it's limited battery and processing power.
Download and install Xcode 6.2 Beta from the Apple Developer Website
Go to https://developer.apple.com/watchkit/ and you can download the beta versions of Xcode 6.2 and iOS 8.2 for testing out features relating to Apple Watch.
Scroll down to the bottom and read both the Apple Watch Design Guide and the Apple Watch Programming Guide.
Download Xcode 6.2 Beta using this link.
Getting Started with WatchKit in Xcode 6.2 Beta
In order to bring you up to speed, I've created a short YouTube video series in 4K resolution that demonstrates how to create a WatchKit app using timers. There are some bugs, but this is the best place to start if you want to work with some cutting edge technology.
Please submit any bug reports to http://bugreport.apple.com and you can help Apple improve WatchKit. Duplicate bug requests are a good thing, because it helps Apple see the more common issues.
Download the Xcode project with the Apple Watch app from github.
Swift WatchKit Tutorial 1 - Get Started with WatchKit to Make apps for the Apple Watch
Swift WatchKit Tutorial 1 - Get Started with WatchKit to Make apps for the Apple Watch WatchKit Course: http://learn.iphonedev.tv/course/make-apps-for-apple-watch Learn how to get started with WatchKit today using iOS 8 and Xcode 6. You can make Apple Watch apps that do basic things right now, native app support is coming sometime next year.
WatchKit Swift Tutorial 2 - Getting Started with your First WatchKit App in Xcode 6 2 Beta
WatchKit Swift Tutorial 2 - Getting Started with your First WatchKit App in Xcode 6 2 Beta WatchKit Course: http://learn.iphonedev.tv/course/make-apps-for-apple-watch Apple Watch Tutorial: Setup your first WatchKit project in Xcode. You need to create a new iPhone app project, which will manage a new WatchKit Target.
WatchKit Swift Tutorial 3 - Apple Watch User Interface Explained
WatchKit Swift Tutorial 3 - Apple Watch User Interface Explained WatchKit Course: http://learn.iphonedev.tv/course/make-apps-for-apple-watch Learn how to customize the User Interface (UI) in your first Apple Watch app. There are limitations and you won't use Auto Layout like in a normal app. It's really different with a grid based layout.
WatchKit Swift Tutorial 4 - Connect the Apple Watch User Interface to Code
WatchKit Swift Tutorial 4 - Connect the Apple Watch User Interface to Code WatchKit Course: http://learn.iphonedev.tv/course/make-apps-for-apple-watch Learn how to use the Assistant Editor to connect your User Interface (UI) from your Apple Watch app to your code file, InterfaceController.swift You can create actions or outlets.
WatchKit Swift Tutorial 5 - Setup a NSTimer in Swift with Apple Watch
WatchKit Swift Tutorial 5 - Setup a NSTimer in Swift with Apple Watch WatchKit Course: http://learn.iphonedev.tv/course/make-apps-for-apple-watch The WatchKit SDK is limited. You can't run code on the Apple Watch with the current beta of WatchKit. This should change when Apple finishes the SDK for native apps.
WatchKit Swift Tutorial 6 - Synchronize NSTimer and WKInterfaceTimer
WatchKit Swift Tutorial 6 - Synchronize NSTimer and WKInterfaceTimer WatchKit Course: http://learn.iphonedev.tv/course/make-apps-for-apple-watch The WKInterfaceTimer runs only on the Apple Watch and doesn't have a callback to the code running in your app extension. In order to keep everything in sync you need to set a duration variable that is of type NSTimerInterval and set it for both the NSTimer and the WKInterfaceTimer.
Connect
- Download the Xcode project on github
- Click the like button below if you enjoyed this post or any of the videos on YouTube.
- I'll be teaching a full Swift + WatchKit course on how to make apps for Apple Watch next year.
- You can start my Swift iPhone app course today with 100+ videos.

