Drop unnecessary downcast
This commit is contained in:
parent
77658e5cc6
commit
d24295295a
|
@ -39,7 +39,7 @@ private struct ShortcutWrapper: Comparable {
|
||||||
|
|
||||||
let intentDescription: String?
|
let intentDescription: String?
|
||||||
|
|
||||||
let original: Any?
|
let original: INVoiceShortcut
|
||||||
|
|
||||||
static func from(_ vs: INVoiceShortcut) -> ShortcutWrapper {
|
static func from(_ vs: INVoiceShortcut) -> ShortcutWrapper {
|
||||||
return ShortcutWrapper(
|
return ShortcutWrapper(
|
||||||
|
@ -199,10 +199,10 @@ class ShortcutsViewController: UITableViewController, INUIAddVoiceShortcutViewCo
|
||||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||||
switch model.row(at: indexPath) {
|
switch model.row(at: indexPath) {
|
||||||
case .shortcut:
|
case .shortcut:
|
||||||
guard let wrapper = wrappers?[indexPath.row], let shortcut = wrapper.original as? INVoiceShortcut else {
|
guard let wrapper = wrappers?[indexPath.row] else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
let vc = INUIEditVoiceShortcutViewController(voiceShortcut: shortcut)
|
let vc = INUIEditVoiceShortcutViewController(voiceShortcut: wrapper.original)
|
||||||
vc.delegate = self
|
vc.delegate = self
|
||||||
editedIndexPath = indexPath
|
editedIndexPath = indexPath
|
||||||
present(vc, animated: true, completion: nil)
|
present(vc, animated: true, completion: nil)
|
||||||
|
|
Loading…
Reference in New Issue