Created
July 9, 2018 11:51
-
-
Save PattoMotto/07d177ae23fb112120390e21b841cc33 to your computer and use it in GitHub Desktop.
VoiceShortcutViewControllerDelegate, full project https://github.com/neungnarakjung/CookBook-Siri-Shortcuts-Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import IntentsUI | |
extension ViewController: INUIAddVoiceShortcutViewControllerDelegate { | |
func addVoiceShortcutViewController(_ controller: INUIAddVoiceShortcutViewController, | |
didFinishWith voiceShortcut: INVoiceShortcut?, | |
error: Error?) { | |
if let error = error as NSError? { | |
print(error) | |
return | |
} | |
updateVoiceShortcuts() | |
dismiss(animated: true, completion: nil) | |
} | |
func addVoiceShortcutViewControllerDidCancel(_ controller: INUIAddVoiceShortcutViewController) { | |
dismiss(animated: true, completion: nil) | |
} | |
} | |
extension ViewController: INUIEditVoiceShortcutViewControllerDelegate { | |
func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, | |
didUpdate voiceShortcut: INVoiceShortcut?, | |
error: Error?) { | |
if let error = error as NSError? { | |
print(error) | |
return | |
} | |
updateVoiceShortcuts() | |
dismiss(animated: true, completion: nil) | |
} | |
func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, | |
didDeleteVoiceShortcutWithIdentifier deletedVoiceShortcutIdentifier: UUID) { | |
updateVoiceShortcuts() | |
dismiss(animated: true, completion: nil) | |
} | |
func editVoiceShortcutViewControllerDidCancel(_ controller: INUIEditVoiceShortcutViewController) { | |
dismiss(animated: true, completion: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment