One Logo Pool Ball
AppIntents · IOS API REFERENCE

IntentModes.Current

struct · iOS 26.0+ · SDK 27.1

struct Current

The current runtime behavior of an app intent. This type provides information about an app intent’s current runtime behavior. When an intent runs, its ``AppIntent/systemContext`` property contains additional contextual information you can use to make decisions. Specifically, the ``IntentSystemContext/currentMode`` property tells you whether the intent is currently running in the foreground or background. Don’t create instances of this type yourself. Instead, compare the value in the ``IntentSystemContext/currentMode`` property to the static values this type defines. You can also check the ``IntentModes/Current/canContinueInForeground`` property to determine if a background intent can switch to the foreground. The following code shows how to use this type from an app intent's ``AppIntent/perform()`` method: ```swift if systemContext.currentMode == .background { if systemContext.currentMode.canContinueInForeground { try await continueInForeground() } else { // The current conditions don't allow the app intent to continue in the foreground, // so it needs to continue in the background. } } ```

Members (4)

get · iOS 26.0+

background

TypeScript
static get background(): IntentModes_Current
Swift declaration
static var background: IntentModes.Current { get }

A value that indicates the app intent is running in the background.

get · iOS 26.0+

foreground

TypeScript
static get foreground(): IntentModes_Current
Swift declaration
static var foreground: IntentModes.Current { get }

A value that indicates the app intent is running in the foreground.

get · iOS 26.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.

get · iOS 26.0+

canContinueInForeground

TypeScript
get canContinueInForeground(): boolean
Swift declaration
var canContinueInForeground: Bool { get }

A Boolean value that indicates whether running the app intent in the foreground is possible. Check the value of this property to determine if running the app intent in the foreground is supported in the current context. Typically, you check this value if your app intent supports both foreground and background runtime modes, and need to switch from background to foreground.

Skipped declarations

No declarations were skipped in this snapshot.

All AppIntents types →