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() {
|
||||
navigationItem.searchController?.isActive = true
|
||||
navigationItem.searchController?.searchBar.selectedScopeButtonIndex = 1
|
||||
navigationItem.searchController?.searchBar.becomeFirstResponder()
|
||||
}
|
||||
|
||||
func focus() {
|
||||
|
|
|
@ -327,7 +327,14 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||
|
||||
func showSearch() {
|
||||
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
|
||||
|
@ -633,13 +640,13 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||
if indexPath == nil {
|
||||
if rootSplitViewController.isCollapsed {
|
||||
if masterNavigationController.children.last is DetailViewController {
|
||||
masterNavigationController.popViewController(animated: false)
|
||||
masterNavigationController.popViewController(animated: !automated)
|
||||
}
|
||||
} else {
|
||||
let systemMessageViewController = UIStoryboard.main.instantiateController(ofType: SystemMessageViewController.self)
|
||||
installDetailController(systemMessageViewController, automated: automated)
|
||||
}
|
||||
masterTimelineViewController?.updateArticleSelection(animate: true)
|
||||
masterTimelineViewController?.updateArticleSelection(animate: !automated)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -17,21 +17,22 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||
// UIWindowScene delegate
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
|
||||
window = UIWindow(windowScene: scene as! UIWindowScene)
|
||||
window!.tintColor = AppAssets.netNewsWireBlueColor
|
||||
window!.rootViewController = coordinator.start()
|
||||
window!.makeKeyAndVisible()
|
||||
|
||||
if let shortcutItem = connectionOptions.shortcutItem {
|
||||
window!.makeKeyAndVisible()
|
||||
handleShortcutItem(shortcutItem)
|
||||
return
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue