Last month Apple released the anticipated WatchKit Framework for developers in the form of iOS 8.2 beta SDK release. The WatchKit framework enable the developers to create Apple Watch applications. In this article we are going to focus on the basics of getting started with the WatchKit framework and developing apps for the Apple Watch.

Prerequisites:

As mentioned earlier WatchKit is released with the iOS 8.2 beta SDK. You can login to the Apple Developer website and download the beta releases. Once, you have installed the new Xcode you are ready to dive into the WatchKit Framework.

Implementation:

Currently, Apple Watch applications cannot exist independently. The watch applications must be accompanied by an iOS (iPhone/iPad) applications. As, the platform matures Apple will certainly allow independent Apple Watch applications.

To get started create a simple Single View Application in Xcode. After that add a new target as "Apple Watch" application as shown in the screenshot below:



This will add two new projects to the application. One will be the Apple Watch Extensions and the second will the Apple Watch app. The extension project allows the communication between the iPhone app and the Apple Watch App. The Apple Watch project simply contains the storyboard which is used to design the layout and the interface for the Apple Watch application. You can think of the Apple Watch project as a shell which is only used to display the content on the screen.

Open the Apple Watch project and drag and drop a label on the screen. Change the text of the label to "Hello World" as indicated in the screenshot below:



Now, it is time to run the Watch App. In the simulator configure the Apple Watch simulator using the following steps:

Hardware -> External Displays -> Apple Watch - 38mm or Apple Watch - 42mm



At this point you can select the "Apple Watch App" scheme and run the app. This will run your simple "Hello World" application.

Conclusion:

In this article we learned about how to get started with Apple Watch development using the WatchKit framework. In the future article we will explore many different aspects of WatchKit development including sharing data, utilizing TableViews, GPS etc.