mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-06 04:07:54 +00:00
Rename the Find in Article notification handler to handleFindInArticle. Disable Find menu items when no web view.
This commit is contained in:
1 parent
63edb5cbc5
commit
84e653a238
3 files changed
+12
-19
No files matched your search
@@ -25,17 +25,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"%d of %d" : {
|
||||
"comment" : "Results selection and count",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "%1$d of %2$d"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"%d unread" : {
|
||||
"comment" : "Unread"
|
||||
},
|
||||
@@ -1032,9 +1021,6 @@
|
||||
"No Errors Logged" : {
|
||||
"comment" : "Error log empty state"
|
||||
},
|
||||
"No results" : {
|
||||
"comment" : "No results"
|
||||
},
|
||||
"None" : {
|
||||
"comment" : "None"
|
||||
},
|
||||
|
||||
@@ -236,7 +236,7 @@ final class ArticleViewController: UIViewController {
|
||||
controller.hideBars()
|
||||
}
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(beginFind(_:)), name: .FindInArticle, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleFindInArticle(_:)), name: .FindInArticle, object: nil)
|
||||
|
||||
updateUI()
|
||||
}
|
||||
@@ -464,12 +464,12 @@ public extension Notification.Name {
|
||||
|
||||
extension ArticleViewController {
|
||||
|
||||
@objc func beginFind(_ _: Any? = nil) {
|
||||
currentWebViewController?.findInteraction?.presentFindNavigator(showingReplace: false)
|
||||
@objc func handleFindInArticle(_ notification: Notification) {
|
||||
presentFindNavigator()
|
||||
}
|
||||
|
||||
override func find(_ sender: Any?) {
|
||||
beginFind()
|
||||
presentFindNavigator()
|
||||
}
|
||||
|
||||
override func findNext(_ sender: Any?) {
|
||||
@@ -490,6 +490,9 @@ extension ArticleViewController {
|
||||
if action == #selector(useSelectionForFind(_:)) {
|
||||
return currentWebViewController?.canUseSelectionForFind ?? false
|
||||
}
|
||||
if action == #selector(find(_:)) || action == #selector(findNext(_:)) || action == #selector(findPrevious(_:)) {
|
||||
return currentWebViewController?.findInteraction != nil
|
||||
}
|
||||
return super.canPerformAction(action, withSender: sender)
|
||||
}
|
||||
}
|
||||
@@ -596,6 +599,10 @@ extension ArticleViewController: UIGestureRecognizerDelegate {
|
||||
|
||||
private extension ArticleViewController {
|
||||
|
||||
func presentFindNavigator() {
|
||||
currentWebViewController?.findInteraction?.presentFindNavigator(showingReplace: false)
|
||||
}
|
||||
|
||||
func createWebViewController(_ article: Article?, updateView: Bool = true) -> WebViewController {
|
||||
let controller = WebViewController()
|
||||
controller.coordinator = coordinator
|
||||
|
||||
@@ -1032,7 +1032,7 @@ extension WebViewController: @preconcurrency SFSafariViewControllerDelegate {
|
||||
extension WebViewController {
|
||||
|
||||
var findInteraction: UIFindInteraction? {
|
||||
return webView?.findInteraction
|
||||
webView?.findInteraction
|
||||
}
|
||||
|
||||
/// Whether the article has selected text to search for.
|
||||
|
||||
Reference in new issue
Block a user