From the course: Apple watchOS App Development: Advanced APIs

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Frontmost app state

Frontmost app state

From the course: Apple watchOS App Development: Advanced APIs

Start my 1-month free trial

Frontmost app state

- [Narrator] WatchOS interactions are only a few seconds long. You'll look at your watch, then put down your arm, sending the watch to the Lock state. On the iPhone, the locking of your phone or moving to another app, would send the app either to be suspended or to the background. On a watch, you'll find there is an intermediate state called the frontmost app state. Let's take a look at that. We'll load the starter project from the Exercise files. Mine is right behind my watch here so I'm going to scoot it over a little bit, hit Exercise files, chapter one, one, begin, SimpleTimer and start up the SimpleTimer. You'll find a very simple app for a timer in seconds. It's interface is labels and buttons. It also has a short about interface, with a push segway. Switch over to the code in the InterfaceController.swift and you'll find the beginnings of a SimpleTimer application. In the Start Button Tapped function, I have a toggle to start or pause the timer. I have a simple function to put…

Contents