Enough talking about theory, lets see some action.
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: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:
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:
Click on Finish, and now you have an iPhone app with the built-in WatchKit extension and WatchKit app.