Created
June 6, 2018 14:37
-
-
Save olbrichj/447d4889269bbd852c425ad43204ccb2 to your computer and use it in GitHub Desktop.
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
if let shortcut = voiceShortcutDataManager?.voiceShortcut(for: order) { | |
let editVoiceShortcutViewController = INUIEditVoiceShortcutViewController(voiceShortcut: shortcut) | |
editVoiceShortcutViewController.delegate = self | |
present(editVoiceShortcutViewController, animated: true, completion: nil) | |
} | |
else { | |
if let shortcut = INShortcut(intent: order.intent) { | |
let addVoiceShortcutVC = INUIAddVoiceShortcutViewController(shortcut: shortcut) | |
addVoiceShortcutVC.delegate = self | |
present(addVoiceShortcutVC, animated: true, completion: nil) | |
} | |
} | |
extension ViewController: INUIAddVoiceShortcutViewControllerDelegate { | |
func addVoiceShortcutViewController(_ controller: INUIAddVoiceShortcutViewController, didFinishWith voiceShortcut: INVoiceShortcut?, error: Error?) { | |
} | |
func addVoiceShortcutViewControllerDidCancel(_ controller: INUIAddVoiceShortcutViewController) { | |
} | |
} | |
extension ViewController: INUIEditVoiceShortcutViewControllerDelegate { | |
func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didUpdate voiceShortcut: INVoiceShortcut?, error: Error?) { | |
} | |
func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didDeleteVoiceShortcutWithIdentifier deletedVoiceShortcutIdentifier: UUID) { | |
} | |
func editVoiceShortcutViewControllerDidCancel(_ controller: INUIEditVoiceShortcutViewController) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment