IntentAction

@available(iOS 12, *)
public protocol IntentAction : IntentBackgroundAction

Adopt this protocol when implementing an action that fulfills a Siri Intent via an Intent Extension

  • The type of the INIntent thatt this action will implement. This is the Xcode-generated response type produced from your intent definition configuration.

    Declaration

    Swift

    associatedtype IntentType : FlintIntent
  • The type of the INIntentResponse for the INIntent. This is the Xcode-generated response type produced from your intent definition configuration.

    Declaration

    Swift

    associatedtype IntentResponseType : FlintIntentResponse where Self.PresenterType == IntentResponsePresenter<Self.IntentResponseType>
  • Automatic aliasing of the presenter to the appropriate type for Intents

    Declaration

    Swift

    typealias PresenterType = IntentResponsePresenter<IntentResponseType>
  • Implement this function if the Action supports a Siri Intent for Shortcuts. This is used to register a shortcut intent with Siri if you have the IntentShortcutDonationFeature enabled.

    • param input: The input instance. Read properties of this to create an instance of the intent type.

    Declaration

    Swift

    @available(iOS 12, *)
    static func intent(for input: InputType) -> IntentType?
  • Implement this function to create a valid input for the action from and instance of the IntentType, used when performing the action for an intent.

    • param intent: The intent instance. Read properties of this to create an instance of the input type.

    Declaration

    Swift

    @available(iOS 12, *)
    static func input(for intent: IntentType) -> InputType?