fix issue #18: broken 3d touch cased by name of shortcut item

This commit is contained in:
Bob Sun 2017-02-22 13:11:27 +08:00
parent a2bcbe1804
commit 6618305e89
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -26,7 +26,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
SVProgressHUD.setMinimumSize(CGSize(width: 150, height: 100))
passcodeLockPresenter.present()
if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem {
if shortcutItem.type == "me.mssun.pass.search" {
if shortcutItem.type == "me.mssun.passforios.search" {
self.perform(#selector(postSearchNotification), with: nil, afterDelay: 0.4)
}
}
@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
if shortcutItem.type == "me.mssun.pass.search" {
if shortcutItem.type == "me.mssun.passforios.search" {
let tabBarController = self.window!.rootViewController as! UITabBarController
tabBarController.selectedIndex = 0
let navigationController = tabBarController.selectedViewController as! UINavigationController