---
title: INUIAddVoiceShortcutButton
framework: intentsui
role: symbol
role_heading: Class
path: intentsui/inuiaddvoiceshortcutbutton
---

# INUIAddVoiceShortcutButton

## INUIAddVoiceShortcutButton

INUIAddVoiceShortcutButton Class of IntentsUI A button that allows the user to add or edit a shortcut.

``` class INUIAddVoiceShortcutButton ```

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.

Set the [shortcut](/documentation/intentsui/inuiaddvoiceshortcutbutton/shortcut) property on the button to have it automatically update the status of the shortcut. If the user has already added the shortcut to Siri, the button displays “Added” instead of “Add” and includes the phrase that the user chose when adding the shortcut. The methods in [INUIAddVoiceShortcutButtonDelegate](/documentation/intentsui/inuiaddvoiceshortcutbuttondelegate) aren’t called unless the [shortcut](/documentation/intentsui/inuiaddvoiceshortcutbutton/shortcut) property is set.

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

The code listing below adds an “Add to Siri” button to a view and lets 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

[NSButton](/documentation/AppKit/NSButton) [UIButton](/documentation/UIKit/UIButton)

Conforms To

[CALayerDelegate](/documentation/QuartzCore/CALayerDelegate) [CVarArg](/documentation/Swift/CVarArg) [CustomDebugStringConvertible](/documentation/Swift/CustomDebugStringConvertible) [CustomStringConvertible](/documentation/Swift/CustomStringConvertible) [Equatable](/documentation/Swift/Equatable) [Hashable](/documentation/Swift/Hashable) [NSAccessibilityButton](/documentation/AppKit/NSAccessibilityButton) [NSAccessibilityElementProtocol](/documentation/AppKit/NSAccessibilityElementProtocol) [NSAccessibilityProtocol](/documentation/AppKit/NSAccessibilityProtocol) [NSAnimatablePropertyContainer](/documentation/AppKit/NSAnimatablePropertyContainer) [NSAppearanceCustomization](/documentation/AppKit/NSAppearanceCustomization) [NSCoding](/documentation/Foundation/NSCoding) [NSDraggingDestination](/documentation/AppKit/NSDraggingDestination) [NSObjectProtocol](/documentation/ObjectiveC/NSObjectProtocol) [NSStandardKeyBindingResponding](/documentation/AppKit/NSStandardKeyBindingResponding) [NSTouchBarProvider](/documentation/AppKit/NSTouchBarProvider) [NSUserActivityRestoring](/documentation/AppKit/NSUserActivityRestoring) [NSUserInterfaceCompression](/documentation/AppKit/NSUserInterfaceCompression) [NSUserInterfaceItemIdentification](/documentation/AppKit/NSUserInterfaceItemIdentification) [NSUserInterfaceValidations](/documentation/AppKit/NSUserInterfaceValidations) [Sendable](/documentation/Swift/Sendable) [SendableMetatype](/documentation/Swift/SendableMetatype) [UIAccessibilityContentSizeCategoryImageAdjusting](/documentation/UIKit/UIAccessibilityContentSizeCategoryImageAdjusting) [UIAccessibilityIdentification](/documentation/UIKit/UIAccessibilityIdentification) [UIActivityItemsConfigurationProviding](/documentation/UIKit/UIActivityItemsConfigurationProviding) [UIAppearance](/documentation/UIKit/UIAppearance) [UIAppearanceContainer](/documentation/UIKit/UIAppearanceContainer) [UIContextMenuInteractionDelegate](/documentation/UIKit/UIContextMenuInteractionDelegate) [UICoordinateSpace](/documentation/UIKit/UICoordinateSpace) [UIDynamicItem](/documentation/UIKit/UIDynamicItem) [UIFocusEnvironment](/documentation/UIKit/UIFocusEnvironment) [UIFocusItem](/documentation/UIKit/UIFocusItem) [UIFocusItemContainer](/documentation/UIKit/UIFocusItemContainer) [UILargeContentViewerItem](/documentation/UIKit/UILargeContentViewerItem) [UIPasteConfigurationSupporting](/documentation/UIKit/UIPasteConfigurationSupporting) [UIPopoverPresentationControllerSourceItem](/documentation/UIKit/UIPopoverPresentationControllerSourceItem) [UIResponderStandardEditActions](/documentation/UIKit/UIResponderStandardEditActions) [UISpringLoadedInteractionSupporting](/documentation/UIKit/UISpringLoadedInteractionSupporting) [UITraitChangeObservable](/documentation/UIKit/UITraitChangeObservable-67e94) [UITraitEnvironment](/documentation/UIKit/UITraitEnvironment) [UIUserActivityRestoring](/documentation/UIKit/UIUserActivityRestoring)
