<!--
{
  "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/IntentModes/foreground(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents11IntentModesV10foregroundyA2C14ForegroundModeVFZ"
  },
  "title" : "foreground(_:)"
}
-->

# foreground(_:)

Creates and returns a foreground mode with a specified behavior.

```
static func foreground(_ foregroundMode: IntentModes.ForegroundMode) -> IntentModes
```

## Parameters

`foregroundMode`

The foreground behavior to apply to the app intent. For example,
specify [`immediate`](/documentation/AppIntents/IntentModes/ForegroundMode/immediate) to bring the app to the foreground before running the app intent.

## Return Value

A set of options that describes the foreground behavior.

---

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)