Class

WKExtendedRuntimeSession

A session that continues to run your app after the user has stopped interacting.

Declaration

class WKExtendedRuntimeSession : NSObject

Overview

With extended runtime sessions, your app continues to run after the user stops interacting with it. The app can continue to communicate with Bluetooth devices, process data, or play sounds or haptics, even after the watch’s screen turns off.

Each app can support a single type of extended runtime session: self care, mindfulness, physical therapy, smart alarm, or health monitoring. Select the session by enabling the appropriate Background Modes capability.

For more information, see Using Extended Runtime Sessions.

Topics

Creating a Session

var delegate: WKExtendedRuntimeSessionDelegate?

A delegate object for monitoring the session and responding to state changes and errors.

protocol WKExtendedRuntimeSessionDelegate

A set of optional methods for monitoring an extended runtime session.

Managing the Session State

func start()

Starts running the session.

func start(at: Date)

Schedules a session to start running at a future date.

func invalidate()

Stops the session.

var state: WKExtendedRuntimeSessionState

The session’s current state.

enum WKExtendedRuntimeSessionState

The activation states for an extended runtime session.

var expirationDate: Date?

The time and date when the session expires.

Relationships

Inherits From

Conforms To

See Also

Extended Runtime Sessions

Using Extended Runtime Sessions

Create an extended runtime session that continues running your app after the user stops interacting with it.

enum WKExtendedRuntimeSessionErrorCode

The error codes reported by extended runtime sessions.

let WKExtendedRuntimeSessionErrorDomain: String

The domain for errors reported by extended runtime sessions.