Fix bug of hard press search

- bug introduced in d86ee90eb7
This commit is contained in:
Yishi Lin 2017-06-09 18:39:52 +08:00
parent c546828df3
commit 545aceb7af

View file

@ -30,7 +30,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
passcodeLockPresenter.present()
if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem {
var searchType = Bundle.main.bundleIdentifier!
searchType.append("search")
searchType.append(".search")
if shortcutItem.type == searchType {
self.perform(#selector(postSearchNotification), with: nil, afterDelay: 0.4)
}
@ -45,7 +45,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
var searchType = Bundle.main.bundleIdentifier!
searchType.append("search")
searchType.append(".search")
if shortcutItem.type == searchType {
let tabBarController = self.window!.rootViewController as! UITabBarController
tabBarController.selectedIndex = 0