appIntentsExtension
TypeScriptget appIntentsExtension(): IntentExecutionTargetsSwift declarationstatic var appIntentsExtension: IntentExecutionTargets { get }The system performs the intent or query in your app intents extension.
struct · iOS 27.0+ · SDK 27.1
struct IntentExecutionTargetsA set of options that describes which process performs an intent or entity query. If you reuse intents and entities between your app, widget extension, or App Intents extension by using a Swift package or framework, the system may perform your ``AppIntent`` or ``EntityQuery`` from the app or App Intents extension. By default, the system performs an intent or entity query using any available target. Use `IntentExecutionTargets` to tell the system which targets can perform your ``AppIntent`` or ``EntityQuery``. For example, a browser app might represent browser tabs and bookmarks as app entities and offer app intents to add a bookmark or open a browser tab. Adding a bookmark might be an action that can happen while the app isn't visible, so performing the action in the App Intents extension makes sense. However, opening a new tab makes sense only when the app is visible, requiring the system to perform the intent in the app's process. The following example shows an app intent that the system performs in either the main app or the app intents extension: ```swift struct MyIntent: AppIntent { static var allowedExecutionTargets: IntentExecutionTargets { [.main, .appIntentsExtension] } } ```
get appIntentsExtension(): IntentExecutionTargetsSwift declarationstatic var appIntentsExtension: IntentExecutionTargets { get }The system performs the intent or query in your app intents extension.
formIntersection($self: IntentExecutionTargets, other: IntentExecutionTargets): voidSwift declarationmutating func formIntersection(_ other: IntentExecutionTargets)Removes the elements of this set that aren't also in the given set. In the following example, the elements of the `employees` set that are not also members of the `neighbors` set are removed. In particular, the names `"Alicia"`, `"Chris"`, and `"Diana"` are removed. var employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"] let neighbors: Set = ["Bethany", "Eric", "Forlani", "Greta"] employees.formIntersection(neighbors) print(employees) // Prints "["Bethany", "Eric"]" - Parameter other: A set of the same type as the current set.
get widgetKitExtension(): IntentExecutionTargetsSwift declarationstatic var widgetKitExtension: IntentExecutionTargets { get }The system performs the intent or query in a widget extension.
formSymmetricDifference($self: IntentExecutionTargets, other: IntentExecutionTargets): voidSwift declarationmutating func formSymmetricDifference(_ other: IntentExecutionTargets)Removes the elements of the set that are also in the given set and adds the members of the given set that are not already in the set. In the following example, the elements of the `employees` set that are also members of `neighbors` are removed from `employees`, while the elements of `neighbors` that are not members of `employees` are added to `employees`. In particular, the names `"Bethany"` and `"Eric"` are removed from `employees` while the name `"Forlani"` is added. var employees: Set = ["Alicia", "Bethany", "Diana", "Eric"] let neighbors: Set = ["Bethany", "Eric", "Forlani"] employees.formSymmetricDifference(neighbors) print(employees) // Prints "["Diana", "Forlani", "Alicia"]" - Parameter other: A set of the same type.
get main(): IntentExecutionTargetsSwift declarationstatic var main: IntentExecutionTargets { get }The system performs the intent or query in the main app process.
get default(): IntentExecutionTargetsSwift declarationstatic var `default`: IntentExecutionTargets { get }The system performs the intent or query in any available target.
init(rawValue: number): IntentExecutionTargetsSwift declarationinit(rawValue: Int)Creates a new option set from the given raw value. This initializer always succeeds, even if the value passed as `rawValue` exceeds the static properties declared as part of the option set. This example creates an instance of `ShippingOptions` with a raw value beyond the highest element, with a bit mask that effectively contains all the declared static members. let extraOptions = ShippingOptions(rawValue: 255) print(extraOptions.isStrictSuperset(of: .all)) // Prints "true" - Parameter rawValue: The raw value of the option set to create. Each bit of `rawValue` potentially represents an element of the option set, though raw values may include bits that are not defined as distinct values of the `OptionSet` type.
getRawValue($self: IntentExecutionTargets): numberSwift declarationvar rawValue: IntThe corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"
setRawValue($self: IntentExecutionTargets, value: number): voidSwift declarationvar rawValue: IntThe corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"
formUnion($self: IntentExecutionTargets, other: IntentExecutionTargets): voidSwift declarationmutating func formUnion(_ other: IntentExecutionTargets)Adds the elements of the given set to the set. In the following example, the elements of the `visitors` set are added to the `attendees` set: var attendees: Set = ["Alicia", "Bethany", "Diana"] let visitors: Set = ["Diana", "Marcia", "Nathaniel"] attendees.formUnion(visitors) print(attendees) // Prints "["Diana", "Nathaniel", "Bethany", "Alicia", "Marcia"]" If the set already contains one or more elements that are also in `other`, the existing members are kept. var initialIndices = Set(0..<5) initialIndices.formUnion([2, 3, 6, 7]) print(initialIndices) // Prints "[2, 4, 6, 7, 0, 1, 3]" - Parameter other: A set of the same type as the current set.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
IntentExecutionTargets.init(arrayLiteral:)
A variable number of Swift arguments is not supported.