---
title: "addVoiceShortcutViewController(_:didFinishWith:error:)"
framework: IntentsUI
role: symbol
role_heading: Instance Method
platforms: [iOS 12.0+, iPadOS 12.0+, Mac Catalyst 13.1+, macOS 12.0+, visionOS 1.0+]
path: "intentsui/inuiaddvoiceshortcutviewcontrollerdelegate/addvoiceshortcutviewcontroller(_:didfinishwith:error:)"
---

# addVoiceShortcutViewController(_:didFinishWith:error:)

Tells the delegate the view controller added the shortcut to Siri.

## Declaration

```swift
func addVoiceShortcutViewController(_ controller: INUIAddVoiceShortcutViewController, didFinishWith voiceShortcut: INVoiceShortcut?, error: (any Error)?)
```

## Parameters

- `controller`: The view controller calling this method.
- `voiceShortcut`: The shortcut added to Siri. This parameter is nil when the controller isn’t able to add the shortcut to Siri.
- `error`: A error object if an error occurred adding the shortcut; otherwise, nil.

## See Also

### Handling View Controller Events

- [addVoiceShortcutViewControllerDidCancel(_:)](intentsui/inuiaddvoiceshortcutviewcontrollerdelegate/addvoiceshortcutviewcontrollerdidcancel(_:).md)
