Subscribe to our Newsletter

Receive our news and insights

Blog / Wearables  

From iOS to watchOS development

A Picture of Francesca Haro
By:
February 18, 2020 | Topic: Wearables  
From iOS to watchOS development

Introduction

Are you ready to expand your iOS app usability? Since its launch in 2015, the Apple Watch, or watch for short, has strived to be a useful companion for iPhones. An Apple Watch application works as an extension of an iPhone app, allowing users to access its main functions just with the watch. Moreover, watchOS, the OS of the Apple Watch, is based on iOS, which makes it easy to learn for iOS developers.

In September 2019, Apple released watchOS 6. One of the greatest novelties of this update is the possibility of creating watch applications independently from iOS apps. Furthermore, this version also includes features like being able to receive push notifications directly on the watch itself, implement sign in more easily, include more services and frameworks, and a whole bunch of other features.

In this article, we’ll show you how to create your first standalone Apple Watch application, the most important things you need to consider before developing an Apple Watch App, and some of the most relevant advantages and differences of a standalone app over an extension from an iOS app.

Before developing an Apple Watch app

If you’re already familiar with iOS development, creating a watch app will be really easy, since it’s also based on Swift and the flow is very similar. Nonetheless, due to the watch’s limitations, there are some aspects that you should consider before developing an Apple Watch app, such as the shorter battery life and the smaller screen. For this reason, we recommend to keep the following in mind when designing Apple Watch apps:

  • The Apple Watch has a really tiny screen and it comes in four different sizes: 44mm, 42mm, 40mm and 38mm. Make sure to check the Apple Human Interface Guidelines so you have an idea of the correct button sizes and other elements that require user interaction.
  • Keep in mind that the user doesn’t want to spend too much time using the watch, so keep the UI and flow of the app simple and practical.
    The Apple Watch has no keyboard, so the only text input available is via voice dictation, Scribble or connecting via bluetooth to the iPhone or iPad to use its keyboard.
  • Starting from watchOS 6, it is not necessary to have an iPhone connected in order to receive notifications or use location services.
  • The maximum size of storage is 32 GB and the Apple Store is available in watchOS 6.
  • Short battery life. There have been plenty of reports that the Apple Watch battery only lasts a few hours when notifications, bluetooth or a heavy apps are being used.

Creating independent Watch Apps

So now you know some of the aspects we believe are the most important when designing a watch application. It is time to get our hands dirty and start developing!

1. Tools and frameworks

Apple has many operating systems (e.g. iOS, watchOS, tvOS and macOS) depending on the devices where the app is going to run. To develop iOS apps for iPhone and iPad or watchOS apps for Apple Watch you need a Mac computer (macOS 10.11.5 o later) running the latest version of Xcode.

Xcode includes all the features you need to design, develop, and debug an app. Xcode also contains the SDK of all the Apple operating systems like iOS, watchOS, tvOS or macOS, which extends Xcode to include the tools, compilers, and frameworks you need.

2. Creating an Xcode project

On Xcode choose Create a new Xcode project and then choose watchOS as a template. As shown in Figure 1, you’ll have two options: the first one is to create an iOS application with an Apple Watch app as an extension; and the second option is to create a standalone Apple Watch app, which is what we want.

Figure 1. Create an independent watchOS App

If you already have an iOS app with a watchOS app and you want to make it independent, then you should follow these steps:

  1. Go to project general configuration
  2. In Targets, go to Project WatchKit Extension
  3. Check the option called “Supports Running Without iOS App Installation” in Deployment Info.

Once you check the option shown in Figure 2 and run the project, the watchOS app will run independently of the iOS app and you won’t need to run the iPhone simulator, which will provide a much faster debugging experience.

Figure 2. Support running without iOS app installation

3. Apple Watch design

When it comes to design, on iOS apps you can set the position of each element that compose the view by modifying the constraints. There are three main options for setting constraints: 1) You can control-drag between views; 2) you can use the Pin and Align tools; and 3) you can let Interface Builder set up the constraints for you and then edit or modify the results. You can also add constraints to one element that depends on another element in the view, like align center vertically or horizontally, or align top or bottom to the second element in the view.

However, on watchOS apps the design is very limited, there is no concept of constraints and you can’t use coordinates to position the elements. Each element is positioned according to a horizontal parameter (left, center, right) and a vertical parameter (top, center, and bottom). Height and width can be set to a fixed value, related to the container or the content.

Figure 3.2. Apple Watch constraints
Figure 3.1. Apple Watch constraints

Figure 3.1 shows a view containing groups of elements positioned horizontally and vertically. Unlike iOS, watchOS only offers the alignment options shown in Figure 3.2.

4. WatchKit life cycle

The WatchKit life cycle is very similar to the iOS apps cycle. Once you launch the app, the initial interface controller will load to show the views that are implemented on the Storyboard and then the User Interface will be initialized to be shown later. While on iOS apps we use the function viewDidLoad(), on watchOS we should use awakeWithContext() to configure interface objects.

Furthermore, instead of using viewWillAppear() and viewWillDisappear(), on watchOS we use willActivate() when watch view controller is about to be visible to user and didDeactivate() when watch view controller is no longer visible.

Figure 4. WatchKit life cycle (Belatrix Software, 2015)

Advantages and differences

WatchOS 6 has many new features that make an independent watch app have an advantage over an app as an extension. We’ll now show you a list of new features on watchOS 6 and how they’re an advantage.

  • Compass app (Apple Watch Series 5 only): The Compass app shows the direction your Apple Watch Series 5 is facing, your current location, and elevation.
  • App Store on Apple Watch: With watchOS 6 you can browse and download watch apps directly on your wrist with the App Store app on your Apple Watch. So now you can download watchOS apps without having to download the iOS app.
Figure 5. App Store watchOS 6 (Apple Inc., 2020-b)
  • Keyboard: Like AppleTV, you can now connect your watch to your iPad or iPhone via bluetooth. In Figure 5.1 you can see a third option for entering text. Once you touch the keyboard option, an alert will appear on the iPhone or iPad, as shown in Figure 5.2, to use its keyboards with the Apple Watch. This way, using the Apple Watch to log in or send messages is easier.
Figure 5.1. WatchOS keyboard (Apple Inc., 2020-a)
Figure 5.2. WatchOS keyboard (Apple Inc., 2020-a)
  • APNS requests: On watchOS 6 Push notifications, alerts and API requests are enabled. So now you don’t need an iPhone nearby to receive notifications or data.
  • Sign in and sign up: On watchOS 6 you can build sign up authentication directly on the watch. And you can support terms and conditions using the WK alert action API. WatchOS 6 also supports Sign In with Apple, since now you can use the authentication services framework on the watch.

Conclusion

In this article we have learned about some aspects that we must consider before developing a watchOS app, like the screen size, the fact that the Apple Watch has no keyboard for text input, the short battery life and limited storage.

We also learned how to start building an independent Apple Watch app and how to make an existing one independent from the iOS app with the option “Supports Running Without iOS App Installation” on Xcode. So, if you decide to make your watchOS app independent, you would be able to use the authentication services framework to make a Sign In or Sign Up or even use Sign In with Apple for your application. You will also be able to use the iPhone or iPad keyboard for text input on the Apple Watch, so the users can sign in easily.

Finally, with an independent watchOS app, you can implement API requests to manage data directly on the watch app and the user will be able to receive notifications without needing an iPhone nearby. This way, your Apple Watch app will be faster, smoother, and easier to use.

References

Paris Buttfield-Addison, Jon Manning (2016) Chapter 1. Understanding the Apple Watch

Belatrix Software (2015) How To Develop an Apple Watch App

Wildnet Technologies (2016) The Watch App: Developing for Apple Watch

Archer Software (2016) Apple Watch App Development: Tips and Tricks

Apple Inc. (2016) Start Developing iOS Apps. Jump Right In.

Apple Inc. (2020-a) Creating Independent Watch Apps

Apple Inc. (2020-b) Apple Watch User Guide. What’s new in watchOS 6

Service Design: Providing meaningful end-to-end experiences

Related Services

EXECUTIVE INSIGHTS

Corporate  

What’s the impact of Covid-19 on company culture?

By

March 25 / 2020

1 Stars2 Stars3 Stars4 Stars5 Stars
Loading...

With the ongoing Covid-19 pandemic, many organizations are having to rapidly adjust their way of working. It’s forcing a digitalization that many companies had spoken about, and perhaps mentioned...

Read post

HOT
TOPIC