• Creative Corner
  • Tips
  • Blog
25 January, 2017

Fundamental Concept of WatchOS

9series | 0Comment(s)

As we all know, the latest WatchOS has been released which brings you faster performance, easy navigation, advanced fitness features, the Breathe app and more powerful Messages.

Fundamental Concept of WatchOS

Being an iOS application developer we first need to check with its basic concepts, how the structure is defined, what kind of execution is there, etc.

Hence, we, 9series, are releasing our first article with basic concepts, frameworks, design patterns, architecture of Watch OS.

So, let’s start with this theoretical chapter:

What is WatchOS ?

WatchOS is the mobile operating system of the Apple Watch, developed by Apple Inc. It is based on the iOS operating system and has many similar features.

Developing for apple watch means providing your user important, impactful, helpful information in a most convenient way.

What is WatchKit?

WatchKit is Apple’s framework for building apps from Apple Watch,and it is bundled with Xcode. WatchKit watch app is not a standalone app instead they require to pair with an iOS app running on the user’s iPhone.The watch app you built will just be an extension of iPhone app.The iPhone app is responsible for managing and maintaining the Watch app.The iPhone app communicates with Watch app using watchKit.

The most important thing to understand about Watchkit app is that the Apple watch is just an external display for a program running on a connected iPhone.

Screen Size

The Apple watch will come in two screen size 38mm and 42mm with retina display. We do not need to design for both screen size Xcode will automatically adapt the layout to fit the screen size.There is no autolayout however watchkit use its own layout system.

Watch App Architecture

When the user selects your Watch app from the Home screen, watchOS launches it into the foreground. Your app remains in the foreground until the user dismisses it. Even when not in the foreground, your app may still run periodically. Specifically, apps run in the background when their complication is on the current watch face, when the app is in the dock, and when they are handling notifications. In addition, apps in the dock and apps with an active complications remain in memory, which lets the system launch them more quickly.

 

Watch App Architecture

WatchKit App Project Structure

By adding a WatchKit application to our project, Xcode has created two targets for us, one for the WatchKit extension, and one for the WatchKit application.

The project created for Apple Watch consists of two separate bundles: a watch app and a watch kit extension. The watch app bundle contains the storyboards and resource files associated with all of your app’s user interfaces.The watch kit extension bundle contains the extension delegates and the controllers for managing those interfaces and for responding to user interactions.While these bundles are distributed inside an iOS app,they are then installed on the user’s Apple Watch and runs locally on the watch.

A WatchOS Project must include a Watch app, but may also include a glance, custom Notifications and complications. Each of these interface provides a unique way for users to interact with your app, often conveying important information to the user more quickly to the app’s main interface.The glance and notification are included in watch app’s storyboard.The code for managing the glance, notification and complications are part of the watch kit extension.

WatchApp Life Cycle

A. The applicationDidFinishLaunching method is called.
B. The applicationDidBecomeActive or applicationWillResignActive method is called.
C. The applicationWillEnterForeground or applicationDidEnterBackground method is called.

 

WatchApp Life Cycle

What Is an Interface Controller?

An interface controller is an instance of the WKInterfaceController class or a subclass thereof. The WKInterfaceController class is defined in the WatchKit framework.As you know, a view controller controls a view or view hierarchy. An interface controller, however, doesn’t control a view, instead it controls an interface, that is, a screenful of content.

An interface controller controls the behavior of the user interface. With an interface controller, you can configure the user interface of your WatchKit application and respond to the events which WatchKit application forwards to the WatchKit extension.

Interface Controller Life Cycle

The WKInterfaceController are analogous of UIViewController but do have same level access to the view component. For Example You cannot add dynamic Controls and restructure UI.

    • Awake: Performs most of the initialization in this method.This method is used to load any required data, set the values for any interface objects, and prepare your interface to display..
    • WillActive: Called shortly when the watch view controller is about to be visible to the user.
    • didDeactivate: Called when watch view controller is no longer visible to the user.

Types of User Interface

1. Normal Interface : The interface.storyboard consist of different scene and each scene has a corresponding WkInterfaceController.

2. Glance : Glance are Single Page, non-interactive UIs that are intended to provide summary or crucial Data. With a swipe from a bottom of watch face, a glance displays app’s most important information.The glance are non-scrolling and must fit in single screen and the information in glance are read only so glance do not contain buttons,switch and other interactive controls.Tap on glance launch watch app main screen.

 

3. Notification : Local and remote notifications are a way to communicate information to the user even when your app is not running. Both local and remote notification are supported. When an iOS app receives a notification, the operating system will decide whether the user should be notified of this event on the iPhone device or the paired Apple Watch device. If, for example, the iPhone is currently locked and the user recently interacted with the Apple Watch, the notification will most likely be delivered to the watch.

Not all iOS apps receive notifications, of course, but for those who perform it is important. The companion WatchKit app handle those notifications appropriately.

For many WatchKit apps it may not be necessary to make any changes to support notifications. In fact, the only step necessary to provide basic notification support for a WatchKit app is to add appropriate sized notification icons within the AppIcon image set of the WatchKit app bundle.

By default, if a notification arrives for an iOS app with a companion WatchKit app, the system will first decide whether to display the alert on the iPhone or the Apple Watch. In the event where the notification is delivered to the Apple Watch a “short-look” notification scene will first be displayed.

short-look notification scene
    • Short look A Short look notification is provided by the system. Similar to a notification banner that you have received in an iPhone, you don’t have any control over a Short Look notification. A Short look notification displays your app icon, app name and the little string from the notifications payload. When a notification arrives, user checks the Short-Look notification. If the user raises their wrist after a slight pause, the Short look notification will transit to the Long-Look notification.
    • Long-Look A Long-Look notification can be either Static or Dynamic.
      Static:
      A static notification includes a single label that is populated automatically using the notifications payload. You can create a static notification scene in your watch app’s storyboard, but can’t really customize it beyond changing the color of the title.
      Dynamic:
      A dynamic notification requires you to subclass WKUserNotificationInterfaceController. It’s instantiated from your storyboard, and you can provide your own custom interface. Note that there won’t be any guaranty that a dynamic notification interface will be displayed. For eg, if the watch battery is low, the system may decide to show the static notification interface instead they preserve battery as they are less expensive to create Actionable Notification. User can add button or text so they can respond directly. For eg, a notification for a meeting invitation might include buttons to accept or reject the invitation.

Apple ios iphone developer india

Complication:

Complications are small elements that appear on the watch face and provide quick access to frequently used data. A calendar app might,for example,use a complication so that the user can see the date and time of the next upcoming appointment simply by glancing at the clock face in which the complication has been enabled.The system provides built-in complications for weather information, upcoming calendar events, the user’s activity, and many more types of data.The size and placement of complication is determined by watchOS and is based on available space on the selected watch face.

Complication Families: Modular Small,Modular Large,Circular Small,Utilitarian Small,Utilitarian Large

Complication Families:  Modular Small,Modular Large,Circular Small,Utilitarian Small,Utilitarian Large

Thanks for your time to read this article. We hope you enjoyed basic and core concept of Watch OS shared by our best iOS application developers. Stay tuned for our next article very soon which include the features of Watch OS 3.x.

As usual, feel free to share your queries, ideas or points to discuss on “[email protected]”.

Note – Images rights belong to their respective owners.

 

Recent Posts

  • Easy Methods To Share Files From Host To Docker

  • 9series Inc - Clutch Year In Review 2021

  • A Quick Comparison of Docker vs. VM: Which DevOps Tool is Best?

  • Latest Update on Docker Paid Subscription for Big Enterprise

  • How to Become a Successful Travel Agent in New York

Categories

  • .Net MVC (3)
  • AI Solutions (2)
  • Amazon DynamoDB (1)
  • Android (24)
  • Android App Developers (2)
  • Android app development (7)
  • Angularjs Development (4)
  • Apple (25)
  • Artificial Intelligence (1)
  • Artificial Intelligence Solutions (3)
  • Beacon Technology (4)
  • Best Christmas Offer (2)
  • Blockchain Technology (2)
  • Cloud Service (2)
  • Clutch (1)
  • custom mobile app development services (4)
  • DevOps (1)
  • Digital Marketing (9)
  • Django (2)
  • Docker (11)
  • E-Learning Technology (3)
  • Ecommerce (1)
  • Events (4)
  • Flutter app development (1)
  • GDPR (1)
  • Google I/O (1)
  • Graphic Design (12)
  • html5 developers (2)
  • Human Resource (5)
  • Infographics (33)
  • iOS (21)
  • Laravel Development (2)
  • machine development companies in India (1)
  • Machine Learning (4)
  • Marketing (9)
  • mean stack development (1)
  • Microsoft (11)
  • Mobile App Design (3)
  • Mobile App Development (48)
  • Moodle Development (1)
  • next-generation technology (6)
  • Node.js (2)
  • Online Marketing (1)
  • Open Source (11)
  • open source Javascript framework (1)
  • Opening Ceremony (1)
  • Python (3)
  • Python Development (4)
  • Responsive Website Development (9)
  • SaaS App Development (2)
  • Search Engine Optimization (4)
  • Social Media Marketing (2)
  • Software Development Company (2)
  • Technology (44)
  • Testing (11)
  • Top Laravel Development (1)
  • Travel and Hospitality Technology Solution (4)
  • Typescript (1)
  • UI Design Company India (1)
  • UI Design Services (1)
  • UI/UX Design (10)
  • Uncategorized (11)
  • VueJS (3)
  • Web Application Development (8)
  • Website Design (2)
  • Website Development Company (7)

Archives

  • February 2022  (2)
  • January 2022  (1)
  • October 2021  (2)
  • September 2021  (3)
  • August 2021  (3)
  • July 2021  (1)
  • June 2021  (4)
  • May 2021  (1)
  • April 2021  (2)
  • March 2021  (1)
  • February 2021  (3)
  • January 2021  (1)
  • December 2020  (1)
  • November 2020  (2)
  • October 2020  (2)
  • September 2020  (1)
  • August 2020  (3)
  • July 2020  (2)
  • June 2020  (4)
  • May 2020  (3)
  • April 2020  (4)
  • March 2020  (4)
  • February 2020  (3)
  • January 2020  (2)
  • December 2019  (6)
  • November 2019  (1)
  • October 2019  (4)
  • September 2019  (4)
  • August 2019  (5)
  • July 2019  (3)
  • June 2019  (5)
  • May 2019  (2)
  • April 2019  (2)
  • February 2019  (5)
  • January 2019  (2)
  • December 2018  (2)
  • November 2018  (3)
  • October 2018  (6)
  • September 2018  (6)
  • August 2018  (7)
  • July 2018  (5)
  • June 2018  (5)
  • May 2018  (6)
  • April 2018  (8)
  • March 2018  (2)
  • November 2017  (1)
  • October 2017  (1)
  • September 2017  (3)
  • August 2017  (2)
  • July 2017  (3)
  • June 2017  (5)
  • May 2017  (4)
  • April 2017  (6)
  • March 2017  (8)
  • February 2017  (6)
  • January 2017  (4)
  • December 2016  (3)
  • November 2016  (4)
  • October 2016  (2)
  • September 2016  (3)
  • August 2016  (3)
  • July 2016  (2)
  • June 2016  (3)
  • May 2016  (3)
  • April 2016  (2)
  • March 2016  (3)
  • February 2016  (3)
  • January 2016  (4)
  • December 2015  (3)
  • November 2015  (4)
  • October 2015  (4)
  • September 2015  (5)
  • August 2015  (2)
  • July 2015  (2)
  • June 2015  (5)
  • May 2015  (3)
  • March 2015  (3)
  • October 2014  (4)
  • September 2014  (9)
  • August 2014  (4)
  • July 2014  (6)
  • June 2014  (1)
  • May 2014  (3)
  • April 2014  (2)
  • January 2014  (1)