---
title: INUIAddVoiceShortcutViewController
framework: intentsui
role: symbol
role_heading: Class
path: intentsui/inuiaddvoiceshortcutviewcontroller
---

# INUIAddVoiceShortcutViewController

## INUIAddVoiceShortcutViewController

INUIAddVoiceShortcutViewController Class of IntentsUI A view controller that guides the user through the steps for adding a shortcut to Siri.

``` class INUIAddVoiceShortcutViewController ```

Overview

When the user performs an action such as placing an order for tomato soup, the app should provide the option to add the action to Siri as a shortcut. To present this option in your app, use [INUIAddVoiceShortcutButton](/documentation/intentsui/inuiaddvoiceshortcutbutton) to display an *Add to Siri* button. Using this button makes your app consistent with other apps that support Siri Shortcuts.

After creating the button, assign its action to a method that displays [INUIAddVoiceShortcutViewController](/documentation/intentsui/inuiaddvoiceshortcutviewcontroller). This controller steps the user through the process of adding the shortcut to Siri.

To receive notifications of events from the view controller, set the delegate to an object that conforms to the [INUIAddVoiceShortcutViewControllerDelegate](/documentation/intentsui/inuiaddvoiceshortcutviewcontrollerdelegate) protocol.

The listing below adds an *Add to Siri* button to a view and let the user record an invocation phrase.

```swift // Add an "Add to Siri" button to a view. func addSiriButton(to view: UIView) {     let button = INUIAddVoiceShortcutButton(style: .blackOutline)     button.translatesAutoresizingMaskIntoConstraints = false

view.addSubview(button)     view.centerXAnchor.constraint(equalTo: button.centerXAnchor).isActive = true     view.centerYAnchor.constraint(equalTo: button.centerYAnchor).isActive = true

button.addTarget(self, action: #selector(addToSiri(_:)), for: .touchUpInside) }

// Present the Add Shortcut view controller after the // user taps the "Add to Siri" button. @objc func addToSiri(_ sender: Any) {     if let shortcut = INShortcut(intent: orderSoupOfTheDayIntent) {         let viewController = INUIAddVoiceShortcutViewController(shortcut: shortcut)         viewController.modalPresentationStyle = .formSheet         viewController.delegate = self // Object conforming to `INUIAddVoiceShortcutViewControllerDelegate`.         present(viewController, animated: true, completion: nil)     } }

```

Inherits From

[NSViewController](/documentation/AppKit/NSViewController) [UIViewController](/documentation/UIKit/UIViewController)

Conforms To

[CVarArg](/documentation/Swift/CVarArg) [CustomDebugStringConvertible](/documentation/Swift/CustomDebugStringConvertible) [CustomStringConvertible](/documentation/Swift/CustomStringConvertible) [Equatable](/documentation/Swift/Equatable) [Hashable](/documentation/Swift/Hashable) [NSCoding](/documentation/Foundation/NSCoding) [NSEditor](/documentation/AppKit/NSEditor) [NSExtensionRequestHandling](/documentation/Foundation/NSExtensionRequestHandling) [NSObjectProtocol](/documentation/ObjectiveC/NSObjectProtocol) [NSSeguePerforming](/documentation/AppKit/NSSeguePerforming) [NSStandardKeyBindingResponding](/documentation/AppKit/NSStandardKeyBindingResponding) [NSTouchBarProvider](/documentation/AppKit/NSTouchBarProvider) [NSUserActivityRestoring](/documentation/AppKit/NSUserActivityRestoring) [NSUserInterfaceItemIdentification](/documentation/AppKit/NSUserInterfaceItemIdentification) [Sendable](/documentation/Swift/Sendable) [SendableMetatype](/documentation/Swift/SendableMetatype) [UIActivityItemsConfigurationProviding](/documentation/UIKit/UIActivityItemsConfigurationProviding) [UIAppearanceContainer](/documentation/UIKit/UIAppearanceContainer) [UIContentContainer](/documentation/UIKit/UIContentContainer) [UIFocusEnvironment](/documentation/UIKit/UIFocusEnvironment) [UIPasteConfigurationSupporting](/documentation/UIKit/UIPasteConfigurationSupporting) [UIResponderStandardEditActions](/documentation/UIKit/UIResponderStandardEditActions) [UIStateRestoring](/documentation/UIKit/UIStateRestoring) [UITraitChangeObservable](/documentation/UIKit/UITraitChangeObservable-67e94) [UITraitEnvironment](/documentation/UIKit/UITraitEnvironment) [UIUserActivityRestoring](/documentation/UIKit/UIUserActivityRestoring)
