Remove restore title hack that should have been removed when Reader was moved away from the title. Issue #1271

This commit is contained in:
Maurice Parker 2019-11-07 15:03:54 -06:00
parent 94d60fbf34
commit a232c5c040
1 changed files with 0 additions and 15 deletions

View File

@ -99,7 +99,6 @@ class ArticleViewController: UIViewController {
NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(statusesDidChange(_:)), name: .StatusesDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange(_:)), name: UIContentSizeCategory.didChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
articleExtractorButton.addTarget(self, action: #selector(toggleArticleExtractor(_:)), for: .touchUpInside)
toolbarItems?.insert(UIBarButtonItem(customView: articleExtractorButton), at: 6)
@ -205,20 +204,6 @@ class ArticleViewController: UIViewController {
reloadHTML()
}
// Don't delete this even though it looks like it isn't doing anything. This is to work
// around a bug (don't know if it is an Apple one or ours) that happens when the root
// split view controller is not collapsed. When the app goes to the background and then
// comes back to the foreground the article extractor button will disappear. The
// navigationItem will still have a reference to the articleExtractorButton, but if you
// check in the view debugger, the button isn't in the view hierarchy anymore.
// Setting the titleView to nil and then back to the articleExtractorButton hides that
// this happened. If we move the articleExtractorButton to someplace other than the
// titleView, then this code can be safely deleted.
@objc func willEnterForeground(_ note: Notification) {
navigationItem.titleView = nil
navigationItem.titleView = articleExtractorButton
}
// MARK: Actions
@IBAction func toggleArticleExtractor(_ sender: Any) {