From a232c5c0409f7ee6338cf4b7ea299c888ba44a95 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 7 Nov 2019 15:03:54 -0600 Subject: [PATCH] Remove restore title hack that should have been removed when Reader was moved away from the title. Issue #1271 --- iOS/Article/ArticleViewController.swift | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index e45a52f1b..45092950a 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -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) {