Improve launch performance and fix Search home page quick action
This commit is contained in:
parent
546917a866
commit
9f6203e839
|
@ -169,6 +169,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||||
func showSearchAll() {
|
func showSearchAll() {
|
||||||
navigationItem.searchController?.isActive = true
|
navigationItem.searchController?.isActive = true
|
||||||
navigationItem.searchController?.searchBar.selectedScopeButtonIndex = 1
|
navigationItem.searchController?.searchBar.selectedScopeButtonIndex = 1
|
||||||
|
navigationItem.searchController?.searchBar.becomeFirstResponder()
|
||||||
}
|
}
|
||||||
|
|
||||||
func focus() {
|
func focus() {
|
||||||
|
|
|
@ -327,7 +327,14 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
||||||
|
|
||||||
func showSearch() {
|
func showSearch() {
|
||||||
selectFeed(nil)
|
selectFeed(nil)
|
||||||
masterTimelineViewController?.showSearchAll()
|
|
||||||
|
masterTimelineViewController = UIStoryboard.main.instantiateController(ofType: MasterTimelineViewController.self)
|
||||||
|
masterTimelineViewController!.coordinator = self
|
||||||
|
navControllerForTimeline().pushViewController(masterTimelineViewController!, animated: false)
|
||||||
|
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now()) {
|
||||||
|
self.masterTimelineViewController!.showSearchAll()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Notifications
|
// MARK: Notifications
|
||||||
|
@ -633,13 +640,13 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
||||||
if indexPath == nil {
|
if indexPath == nil {
|
||||||
if rootSplitViewController.isCollapsed {
|
if rootSplitViewController.isCollapsed {
|
||||||
if masterNavigationController.children.last is DetailViewController {
|
if masterNavigationController.children.last is DetailViewController {
|
||||||
masterNavigationController.popViewController(animated: false)
|
masterNavigationController.popViewController(animated: !automated)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let systemMessageViewController = UIStoryboard.main.instantiateController(ofType: SystemMessageViewController.self)
|
let systemMessageViewController = UIStoryboard.main.instantiateController(ofType: SystemMessageViewController.self)
|
||||||
installDetailController(systemMessageViewController, automated: automated)
|
installDetailController(systemMessageViewController, automated: automated)
|
||||||
}
|
}
|
||||||
masterTimelineViewController?.updateArticleSelection(animate: true)
|
masterTimelineViewController?.updateArticleSelection(animate: !automated)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,21 +17,22 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||||
// UIWindowScene delegate
|
// UIWindowScene delegate
|
||||||
|
|
||||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||||
|
|
||||||
window = UIWindow(windowScene: scene as! UIWindowScene)
|
window = UIWindow(windowScene: scene as! UIWindowScene)
|
||||||
window!.tintColor = AppAssets.netNewsWireBlueColor
|
window!.tintColor = AppAssets.netNewsWireBlueColor
|
||||||
window!.rootViewController = coordinator.start()
|
window!.rootViewController = coordinator.start()
|
||||||
window!.makeKeyAndVisible()
|
|
||||||
|
|
||||||
if let shortcutItem = connectionOptions.shortcutItem {
|
if let shortcutItem = connectionOptions.shortcutItem {
|
||||||
|
window!.makeKeyAndVisible()
|
||||||
handleShortcutItem(shortcutItem)
|
handleShortcutItem(shortcutItem)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if let userActivity = connectionOptions.userActivities.first ?? session.stateRestorationActivity {
|
if let userActivity = connectionOptions.userActivities.first ?? session.stateRestorationActivity {
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now()) {
|
self.coordinator.handle(userActivity)
|
||||||
self.coordinator.handle(userActivity)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window!.makeKeyAndVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
|
func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
|
||||||
|
|
Loading…
Reference in New Issue