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
From the course: Apple watchOS App Development: Advanced APIs
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Frontmost app state4m 24s
-
(Locked)
The dock and the background states5m 15s
-
(Locked)
The extension delegate7m 25s
-
(Locked)
Challenge: A background app27s
-
(Locked)
Solution: A background app2m 38s
-
Refresh app in the background6m 57s
-
(Locked)
userInfo in background apps7m 48s
-
(Locked)
Update interface with snapshot8m 16s
-
(Locked)
Default snapshots4m 54s
-
(Locked)
-
-
-
-