Prevent the search bar from appearing on rotation. Issue #1171

This commit is contained in:
Maurice Parker 2019-10-30 16:08:03 -05:00
parent 30da68218f
commit 51acc5972f
1 changed files with 7 additions and 1 deletions

View File

@ -57,7 +57,6 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
NSLocalizedString("Here", comment: "Here"), NSLocalizedString("Here", comment: "Here"),
NSLocalizedString("All Articles", comment: "All Articles") NSLocalizedString("All Articles", comment: "All Articles")
] ]
navigationItem.searchController = searchController
definesPresentationContext = true definesPresentationContext = true
// Configure the table // Configure the table
@ -74,6 +73,13 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
super.viewWillAppear(animated) super.viewWillAppear(animated)
} }
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
// You have to assign the search controller here to avoid showing it by default
// https://stackoverflow.com/questions/57581557/how-to-initally-hide-searchbar-in-navigation-controller-on-ios-13
navigationItem.searchController = searchController
}
// MARK: Actions // MARK: Actions
@IBAction func markAllAsRead(_ sender: Any) { @IBAction func markAllAsRead(_ sender: Any) {