<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 12.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SiriKit",
  "identifier" : "/documentation/IntentsUI/INUIAddVoiceShortcutButton",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "IntentsUI"
    ],
    "preciseIdentifier" : "c:objc(cs)INUIAddVoiceShortcutButton"
  },
  "title" : "INUIAddVoiceShortcutButton"
}
-->

# INUIAddVoiceShortcutButton

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)
    }
}
```

## Topics

### Creating a Shortcut Button

[`init(style:)`](/documentation/IntentsUI/INUIAddVoiceShortcutButton/init(style:))

Creates an *Add to Siri* button with the specified style.

[`INUIAddVoiceShortcutButtonStyle`](/documentation/IntentsUI/INUIAddVoiceShortcutButtonStyle)

The styles for the *Add to Siri* button.

### Presenting Shortcut Editors

[`shortcut`](/documentation/IntentsUI/INUIAddVoiceShortcutButton/shortcut)

The shortcut Siri invokes when the user speaks the invocation phrase.

[`delegate`](/documentation/IntentsUI/INUIAddVoiceShortcutButton/delegate)

The object that receives presentation requests from the button.

[`INUIAddVoiceShortcutButtonDelegate`](/documentation/IntentsUI/INUIAddVoiceShortcutButtonDelegate)

The protocol an object implements to receive notifications from the Siri Shortcut button.

### Accessing Shortcut Button Information

[`setStyle(_:)`](/documentation/IntentsUI/INUIAddVoiceShortcutButton/setStyle(_:))

[`style`](/documentation/IntentsUI/INUIAddVoiceShortcutButton/style)

The button style.

[`cornerRadius`](/documentation/IntentsUI/INUIAddVoiceShortcutButton/cornerRadius)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)