Book Image

Application Development with Swift

By : Hossam Ghareeb
Book Image

Application Development with Swift

By: Hossam Ghareeb

Overview of this book

Table of Contents (14 chapters)

Working with WatchKit


Enough talking about theory, lets see some action.

  1. Go to our lovely Xcode and create a new single-view application and name it WatchKitDemo. Don't forget to select Swift as the app language. Then navigate to File | New | Target to create a new target for the WatchKit app:

  2. After you select the target, in the pop-up window, from the left side under iOS choose Apple Watch and select WatchKit App. Check the following screenshot:

  3. After you click on Next, it will ask you which application to embed the target in and which scenes to include. Please check the Include Notification Scene and Include Glance Scene options, as shown in the following screenshot:

  4. Click on Finish, and now you have an iPhone app with the built-in WatchKit extension and WatchKit app.

Xcode targets

Now your project should be divided into three parts. Check the following screenshot and let's explain these parts:

As you see in this screenshot, the project files are divided into three sections. In section 1, you...