One Logo Pool Ball
AppIntents · IOS API REFERENCE

RunSystemShortcutIntent

struct · iOS 27.0+ · SDK 27.1

struct RunSystemShortcutIntent

An app intent you use in widgets to open another app or perform an App Shortcut, custom shortcut, or system action. Only use `RunSystemShortcutIntent` to initialize a <doc://com.apple.documentation/documentation/swiftui/button> with the <doc://com.apple.documentation/documentation/swiftui/button/init(_:intent:)> initializer and place the button in a widget. The run system shortcut intent doesn't provide functionality in other contexts. When a person configures the widget, they choose the button's action. It can: - Open another installed app. - Perform an App Shortcut. - Perform a custom shortcut a person creates in Shortcuts. - Perform a system action. The following example shows how an app offers a widget that allows people to launch another app from a button: ```swift import SwiftUI import WidgetKit import AppIntents struct LauncherWidgetConfigurationIntent: WidgetConfigurationIntent { static var title: LocalizedStringResource { "Launcher Widget" } static var description: IntentDescription { "Widget that runs a shortcut or opens an app" } @Parameter(title: "Action") var shortcut: SystemShortcut } struct LauncherWidget: Widget { let kind: String = "LauncherWidget" var body: some WidgetConfiguration { AppIntentConfiguration( kind: kind, intent: LauncherWidgetConfigurationIntent.self, provider: Provider() ) { entry in Button( intent: RunSystemShortcutIntent(shortcut: entry.configuration.shortcut) ) { VStack { Image(systemName: "play.fill") .font(.largeTitle) Text(entry.configuration.shortcut.displayRepresentation.title) .font(.caption) } } } } } ``` The `RunSystemShortcutIntent` represents a person's chosen action when they configure your widget and it provides metadata the system needs for the widget's configuration UI. It doesn't provide your widget or app with access to a shortcut's actions, parameters, or implementation details. If a custom shortcut or App Shortcut requires an interaction, for example, if it prompts a person for input, the system may open the Shortcuts app to perform the intent.

Members (5)

get · iOS 27.0+

persistentIdentifier

TypeScript
static get persistentIdentifier(): string
Swift declaration
static let persistentIdentifier: String

The string that identifies the intent.

get · iOS 27.0+

title

TypeScript
static get title(): _Foundation_LocalizedStringResource
Swift declaration
static let title: LocalizedStringResource

The localized string that describes the intent's functionality.

method · iOS 27.0+

perform

TypeScript
perform(): Promise<IntentResultContainer<never, never, never, never>>
Swift declaration
func perform() async throws -> IntentResultContainer<Never, Never, Never, Never>

Performs a widget's configured action, like opening another app or performing an App Shortcut, custom shortcut, or system action. The system only performs the intent if it's triggered by a button you place in widget. The intent doesn't have any effect in other contexts.

init · iOS 27.0+

init

TypeScript
static initShortcut(shortcut: SystemShortcut): RunSystemShortcutIntent
Swift declaration
init(shortcut: SystemShortcut)

Creates an intent that performs a person's configured action. - Parameter shortcut: The metadata that represents a person's configured action.

init · iOS 27.0+

init

TypeScript
static init(): RunSystemShortcutIntent
Swift declaration
init()

Creates an intent that performs a person's configured action.

Skipped declarations

No declarations were skipped in this snapshot.

All AppIntents types →