Protocol

INIntentHandlerProviding

The interface for dispatching intents to the custom objects that handle those intents.

Overview

The INIntentHandlerProviding protocol defines the method for routing SiriKit requests to the appropriate objects of your Intents extension. The method in this protocol acts as a dispatcher, returning an object capable of resolving, confirming, and handling a specific intent object. This protocol is adopted by the INExtension class and you must provide a custom implementation.

When you add an Intents extension to your project, Xcode automatically creates a default INExtension subclass that adopts this protocol. Modify the handler(for:) method in that subclass and use it to create your handler objects. You can use the same class to handle multiple intents or you can use different classes for each intent.

Topics

Providing Handlers for Intents

func handler(for: INIntent) -> Any?

Returns the object capable of handling the specified intent.

Required.

Relationships

Inherits From

Adopted By

See Also

Intents App Extension

Structuring Your Code to Support App Extensions

Move your back-end services to a private framework so that they can be used by your app and your app extensions.

Dispatching Intents to Handler Objects

Provide SiriKit with an object capable of handling a given intent.

Resolving and Handling Intents

Resolve, confirm, and handle user requests for your app's services.

Extension-Related Classes

Learn about the classes you use to build your Intents extension.