Contents

Life cycles

Receive and respond to life-cycle notifications.

Overview

The system reports changes in your app’s execution state to your SwiftUI environment and your extension delegate object. State changes correspond to major events in the lifetime of your app, such as the app launching or moving into the background. Use the state changes to trigger relevant tasks, such as loading shared resources and configuring your initial user interface. The table below shows the possible states and their implications for your app.

State

Description

Not running

The watchOS app isn’t running.

Inactive

The watchOS app is running in the foreground, but isn’t receiving actions from controls or gestures.

Active

The watchOS app is running in the foreground and receiving actions from controls and gestures. This is the normal mode for apps running on screen.

Background

The system has given the watchOS app a small amount of background execution time.

Suspended

The app is in memory but isn’t executing code. The system may purge suspended apps at any time to make room for other apps.

For more information, see Handling Common State Transitions.

Receive background information

When the system receives background data, it may not immediately wake the watchOS app to process that data. Instead, it may delay delivery of the data to preserve battery life.

If the app is currently running—either active and onscreen, or inactive and the frontmost app—the system immediately delivers the data to the app. If the app is in the background, the system wakes the app within 10 minutes to deliver the data.

Topics

Responding to life cycle events

See Also

Runtime management