最近在 Xcode 8 beta 6 (8S201h) 中出现了这个问题。
UIApplicationLaunchOptionsShortcutItemKey
这是错误信息:
还有其他人遇到了这个问题吗?
var performShortcutDelegate = true
if let shortcutItem = launchOptions[UIApplicationLaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem {
print("ok")
self.shortcutItem = shortcutItem
performShortcutDelegate = false
}
return performShortcutDelegate
guard
: https://dev59.com/KlsX5IYBdhLWcg3whv_Q - Bistaif #available(iOS 9.0, *) {}
。更多信息/上下文将会很有帮助。 :) - Naftali BederlaunchOptions
,这意味着当你尝试使用它时,它仍然是Optional
类型。你不能从可选字典中提取值,因为它在技术上不是一个字典。那很可能就是问题所在。我已经更新了我的答案来反映这一点,并包括了封闭函数。让我知道它是否有效! - Naftali Beder