Drop unnecessary downcast

This commit is contained in:
Davide De Rosa 2019-03-27 23:03:19 +01:00
parent 77658e5cc6
commit d24295295a
1 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ private struct ShortcutWrapper: Comparable {
let intentDescription: String?
let original: Any?
let original: INVoiceShortcut
static func from(_ vs: INVoiceShortcut) -> ShortcutWrapper {
return ShortcutWrapper(
@ -199,10 +199,10 @@ class ShortcutsViewController: UITableViewController, INUIAddVoiceShortcutViewCo
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch model.row(at: indexPath) {
case .shortcut:
guard let wrapper = wrappers?[indexPath.row], let shortcut = wrapper.original as? INVoiceShortcut else {
guard let wrapper = wrappers?[indexPath.row] else {
break
}
let vc = INUIEditVoiceShortcutViewController(voiceShortcut: shortcut)
let vc = INUIEditVoiceShortcutViewController(voiceShortcut: wrapper.original)
vc.delegate = self
editedIndexPath = indexPath
present(vc, animated: true, completion: nil)