mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Make sure that the search bar doesn't appear on device rotation. Issue #1171
This commit is contained in:
@@ -48,20 +48,6 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
|||||||
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange), name: .DisplayNameDidChange, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange), name: .DisplayNameDidChange, object: nil)
|
||||||
|
|
||||||
|
|
||||||
// Setup the Search Controller
|
|
||||||
searchController.delegate = self
|
|
||||||
searchController.searchResultsUpdater = self
|
|
||||||
searchController.obscuresBackgroundDuringPresentation = false
|
|
||||||
searchController.searchBar.delegate = self
|
|
||||||
searchController.searchBar.placeholder = NSLocalizedString("Search Articles", comment: "Search Articles")
|
|
||||||
searchController.searchBar.scopeButtonTitles = [
|
|
||||||
NSLocalizedString("Here", comment: "Here"),
|
|
||||||
NSLocalizedString("All Articles", comment: "All Articles")
|
|
||||||
]
|
|
||||||
navigationItem.searchController = searchController
|
|
||||||
definesPresentationContext = true
|
|
||||||
|
|
||||||
// Setup the Refresh Control
|
// Setup the Refresh Control
|
||||||
refreshControl = UIRefreshControl()
|
refreshControl = UIRefreshControl()
|
||||||
refreshControl!.addTarget(self, action: #selector(refreshAccounts(_:)), for: .valueChanged)
|
refreshControl!.addTarget(self, action: #selector(refreshAccounts(_:)), for: .valueChanged)
|
||||||
@@ -85,6 +71,21 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
|||||||
updateProgressIndicatorIfNeeded()
|
updateProgressIndicatorIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func viewWillLayoutSubviews() {
|
||||||
|
// If you setup the Search Controller in viewWillLayoutSubviews it won't show by default on creation
|
||||||
|
searchController.delegate = self
|
||||||
|
searchController.searchResultsUpdater = self
|
||||||
|
searchController.obscuresBackgroundDuringPresentation = false
|
||||||
|
searchController.searchBar.delegate = self
|
||||||
|
searchController.searchBar.placeholder = NSLocalizedString("Search Articles", comment: "Search Articles")
|
||||||
|
searchController.searchBar.scopeButtonTitles = [
|
||||||
|
NSLocalizedString("Here", comment: "Here"),
|
||||||
|
NSLocalizedString("All Articles", comment: "All Articles")
|
||||||
|
]
|
||||||
|
navigationItem.searchController = searchController
|
||||||
|
definesPresentationContext = true
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: Actions
|
// MARK: Actions
|
||||||
|
|
||||||
@IBAction func markAllAsRead(_ sender: Any) {
|
@IBAction func markAllAsRead(_ sender: Any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user