One Logo Pool Ball
ActivityKit · IOS API REFERENCE

ActivityUIDismissalPolicy

struct · iOS 16.1+ · SDK 27.1

struct ActivityUIDismissalPolicy

The structure that describes when the system should remove a Live Activity that ended.

Members (3)

static · iOS 16.1+

after

TypeScript
static after(date: globalThis.Date): ActivityUIDismissalPolicy
Swift declaration
static func after(_ date: Date) -> ActivityUIDismissalPolicy

The system removes the Live Activity that ended at the specified time within a four-hour window. Provide a date to tell the system when it should remove a Live Activity that ended. While you can provide any date, the system removes a Live Activity that ended after the specified date or after four hours from the moment the Live Activity ended — whichever comes first. When the system removes the Live Activity, the ``ActivityKit/ActivityState`` changes to ``ActivityKit/ActivityState/dismissed``. - Parameters: - date: A date within a four-hour window from the moment the Live Activity ends.

get · iOS 16.1+

default

TypeScript
static get default(): ActivityUIDismissalPolicy
Swift declaration
static let `default`: ActivityUIDismissalPolicy

The system's default dismissal policy for the Live Activity. With the default dismissal policy, the system keeps a Live Activity that ended on the Lock Screen for up to four hours after it ends or a person removes it. The ``ActivityKit/ActivityState`` doesn't change to ``ActivityKit/ActivityState/dismissed`` until a person or the system removes the Live Activity user interface.

get · iOS 16.1+

immediate

TypeScript
static get immediate(): ActivityUIDismissalPolicy
Swift declaration
static let immediate: ActivityUIDismissalPolicy

The system immediately removes the Live Activity that ended. With the `immediate` dismissal policy, the system immediately removes the ended Live Activity and the ``ActivityKit/ActivityState`` changes to ``ActivityKit/ActivityState/dismissed``.

Skipped declarations

No declarations were skipped in this snapshot.

All ActivityKit types →