background
TypeScriptstatic get background(): IntentModes_CurrentSwift declarationstatic var background: IntentModes.Current { get }A value that indicates the app intent is running in the background.
struct · iOS 26.0+ · SDK 27.1
struct CurrentThe 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. } } ```
static get background(): IntentModes_CurrentSwift declarationstatic var background: IntentModes.Current { get }A value that indicates the app intent is running in the background.
static get foreground(): IntentModes_CurrentSwift declarationstatic var foreground: IntentModes.Current { get }A value that indicates the app intent is running in the foreground.
get debugDescription(): stringSwift declarationvar 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 canContinueInForeground(): booleanSwift declarationvar 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.
No declarations were skipped in this snapshot.