From d24295295af43499ba5a25ba1c4d9d2a02177161 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 27 Mar 2019 23:03:19 +0100 Subject: [PATCH] Drop unnecessary downcast --- .../Scenes/Organizer/ShortcutsViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Passepartout-iOS/Scenes/Organizer/ShortcutsViewController.swift b/Passepartout-iOS/Scenes/Organizer/ShortcutsViewController.swift index 939e5b8f..9686baf3 100644 --- a/Passepartout-iOS/Scenes/Organizer/ShortcutsViewController.swift +++ b/Passepartout-iOS/Scenes/Organizer/ShortcutsViewController.swift @@ -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)