Recently in Xcode 8 beta 6 (8S201h), this has become a problem.
UIApplicationLaunchOptionsShortcutItemKey
Here's the error :
Anyone else having this issue?
var performShortcutDelegate = true
if let shortcutItem = launchOptions[UIApplicationLaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem {
print("ok")
self.shortcutItem = shortcutItem
performShortcutDelegate = false
}
return performShortcutDelegate
guard
: #33690433 – Archiveambiguous reference to member subscript
error? Your code looks correct as shown, so it might have something to do with the enclosing function. It's also possible you need to include the blockif #available(iOS 9.0, *) {}
around your shortcut code. More information/context would be helpful. :) – DoloritaslaunchOptions
, meaning it's still ofOptional
type when you try to use it. You can't pull values from an Optional dictionary, because it's not technically a dictionary. That's likely the issue. I've updated my answer to reflect this, and included the enclosing function as well. Let me know if it works! – Doloritas