<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/AppIntent/supportedModes",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents0A6IntentP14supportedModesAA0cE0VvpZ"
  },
  "title" : "supportedModes"
}
-->

# supportedModes

The foreground and background modes the app intent supports.

```
static var supportedModes: IntentModes { get }
```

## Discussion

Use this property to specify whether your app needs to be in the foreground or
background when running an app intent’s action. You can assign one or more values
to this property:

- Specify [`background`](/documentation/AppIntents/IntentModes/background) to run the action entirely in the background.
- Specify the [`immediate`](/documentation/AppIntents/IntentModes/ForegroundMode/immediate) foreground mode to bring the
  app to the foreground before the action runs.
- Specify the [`dynamic`](/documentation/AppIntents/IntentModes/ForegroundMode/dynamic) foreground mode to run the app
  in the background and optionally transition it to the foreground.
- Specify the [`deferred`](/documentation/AppIntents/IntentModes/ForegroundMode/deferred) foreground mode to run the app
  in the background, and then transition it to the foreground before the action completes.
- Combine the [`foreground`](/documentation/AppIntents/IntentModes/foreground) and [`background`](/documentation/AppIntents/IntentModes/background) options to run
  the app in the foreground whenever possible, but allow it to run in the background
  as needed.
- Combine the [`background`](/documentation/AppIntents/IntentModes/background) and [`dynamic`](/documentation/AppIntents/IntentModes/ForegroundMode/dynamic)
  foreground mode to run the app in either the foreground or background, but to prefer
  the background.
- Combine the [`background`](/documentation/AppIntents/IntentModes/background) and [`deferred`](/documentation/AppIntents/IntentModes/ForegroundMode/deferred)
  foreground mode to start the action in the background and transition to the foreground
  before the action finishes.

The following example shows how to specify the [`background`](/documentation/AppIntents/IntentModes/background) and
[`deferred`](/documentation/AppIntents/IntentModes/ForegroundMode/deferred) foreground modes for this property:

```swift
struct SomeIntent: AppIntent {
    static let supportedModes: IntentModes = [.background, .foreground(.deferred)]

    ...
}
```

In your app intent’s [`perform()`](/documentation/AppIntents/AppIntent/perform()) method, consult the information in the
[`systemContext`](/documentation/AppIntents/AppIntent/systemContext) property of your app intent to determine whether your
code is currently running in the foreground or background.  The [`currentMode`](/documentation/AppIntents/IntentSystemContext/currentMode)
property of [`IntentSystemContext`](/documentation/AppIntents/IntentSystemContext) contains the current mode. You can also
use the [`canContinueInForeground`](/documentation/AppIntents/IntentModes/Current/canContinueInForeground) property to determine if a
transition to the foreground is possible. For more information, see [`IntentModes.Current`](/documentation/AppIntents/IntentModes/Current).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)