mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-04 03:08:43 +00:00
Fix various SwiftLint warnings.
This commit is contained in:
1 parent
d9216a3275
commit
9ff1bd9836
104 files changed
+365
-363
No files matched your search
@@ -321,7 +321,7 @@ extension WebViewController: ArticleExtractorDelegate {
|
||||
extension WebViewController: UIContextMenuInteractionDelegate {
|
||||
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
|
||||
|
||||
return UIContextMenuConfiguration(identifier: nil, previewProvider: contextMenuPreviewProvider) { [weak self] suggestedActions in
|
||||
return UIContextMenuConfiguration(identifier: nil, previewProvider: contextMenuPreviewProvider) { [weak self] _ in
|
||||
guard let self = self else { return nil }
|
||||
|
||||
var menus = [UIMenu]()
|
||||
@@ -530,7 +530,7 @@ private extension WebViewController {
|
||||
return
|
||||
}
|
||||
|
||||
coordinator.webViewProvider.dequeueWebView() { webView in
|
||||
coordinator.webViewProvider.dequeueWebView { webView in
|
||||
|
||||
webView.ready {
|
||||
|
||||
@@ -658,7 +658,7 @@ private extension WebViewController {
|
||||
|
||||
guard let imageURL = URL(string: clickMessage.imageURL) else { return }
|
||||
|
||||
Downloader.shared.download(imageURL) { [weak self] data, response, error in
|
||||
Downloader.shared.download(imageURL) { [weak self] data, _, error in
|
||||
guard let self, let data, error == nil, !data.isEmpty,
|
||||
let image = UIImage(data: data) else {
|
||||
return
|
||||
@@ -751,7 +751,7 @@ private extension WebViewController {
|
||||
func prevArticleAction() -> UIAction? {
|
||||
guard coordinator.isPrevArticleAvailable else { return nil }
|
||||
let title = NSLocalizedString("Previous Article", comment: "Previous Article")
|
||||
return UIAction(title: title, image: Assets.Images.prevArticle) { [weak self] action in
|
||||
return UIAction(title: title, image: Assets.Images.prevArticle) { [weak self] _ in
|
||||
self?.coordinator.selectPrevArticle()
|
||||
}
|
||||
}
|
||||
@@ -759,7 +759,7 @@ private extension WebViewController {
|
||||
func nextArticleAction() -> UIAction? {
|
||||
guard coordinator.isNextArticleAvailable else { return nil }
|
||||
let title = NSLocalizedString("Next Article", comment: "Next Article")
|
||||
return UIAction(title: title, image: Assets.Images.nextArticle) { [weak self] action in
|
||||
return UIAction(title: title, image: Assets.Images.nextArticle) { [weak self] _ in
|
||||
self?.coordinator.selectNextArticle()
|
||||
}
|
||||
}
|
||||
@@ -769,7 +769,7 @@ private extension WebViewController {
|
||||
|
||||
let title = article.status.read ? NSLocalizedString("Mark as Unread", comment: "Mark as Unread") : NSLocalizedString("Mark as Read", comment: "Mark as Read")
|
||||
let readImage = article.status.read ? Assets.Images.circleClosed : Assets.Images.circleOpen
|
||||
return UIAction(title: title, image: readImage) { [weak self] action in
|
||||
return UIAction(title: title, image: readImage) { [weak self] _ in
|
||||
self?.coordinator.toggleReadForCurrentArticle()
|
||||
}
|
||||
}
|
||||
@@ -778,7 +778,7 @@ private extension WebViewController {
|
||||
let starred = article?.status.starred ?? false
|
||||
let title = starred ? NSLocalizedString("Mark as Unstarred", comment: "Mark as Unstarred") : NSLocalizedString("Mark as Starred", comment: "Mark as Starred")
|
||||
let starredImage = starred ? Assets.Images.starOpen : Assets.Images.starClosed
|
||||
return UIAction(title: title, image: starredImage) { [weak self] action in
|
||||
return UIAction(title: title, image: starredImage) { [weak self] _ in
|
||||
self?.coordinator.toggleStarredForCurrentArticle()
|
||||
}
|
||||
}
|
||||
@@ -786,7 +786,7 @@ private extension WebViewController {
|
||||
func nextUnreadArticleAction() -> UIAction? {
|
||||
guard coordinator.isAnyUnreadAvailable else { return nil }
|
||||
let title = NSLocalizedString("Next Unread Article", comment: "Next Unread Article")
|
||||
return UIAction(title: title, image: Assets.Images.nextUnread) { [weak self] action in
|
||||
return UIAction(title: title, image: Assets.Images.nextUnread) { [weak self] _ in
|
||||
self?.coordinator.selectNextUnread()
|
||||
}
|
||||
}
|
||||
@@ -795,14 +795,14 @@ private extension WebViewController {
|
||||
let extracted = articleExtractorButtonState == .on
|
||||
let title = extracted ? NSLocalizedString("Show Feed Article", comment: "Show Feed Article") : NSLocalizedString("Show Reader View", comment: "Show Reader View")
|
||||
let extractorImage = extracted ? Assets.Images.articleExtractorOffSF : Assets.Images.articleExtractorOnSF
|
||||
return UIAction(title: title, image: extractorImage) { [weak self] action in
|
||||
return UIAction(title: title, image: extractorImage) { [weak self] _ in
|
||||
self?.toggleArticleExtractor()
|
||||
}
|
||||
}
|
||||
|
||||
func shareAction() -> UIAction {
|
||||
let title = NSLocalizedString("Share", comment: "Share")
|
||||
return UIAction(title: title, image: Assets.Images.share) { [weak self] action in
|
||||
return UIAction(title: title, image: Assets.Images.share) { [weak self] _ in
|
||||
self?.showActivityDialog()
|
||||
}
|
||||
}
|
||||
@@ -862,8 +862,7 @@ extension WebViewController {
|
||||
}
|
||||
let encoded = json.base64EncodedString()
|
||||
|
||||
webView?.evaluateJavaScript("updateFind(\"\(encoded)\")") {
|
||||
(result, error) in
|
||||
webView?.evaluateJavaScript("updateFind(\"\(encoded)\")") { (result, error) in
|
||||
guard error == nil,
|
||||
let b64 = result as? String,
|
||||
let rawData = Data(base64Encoded: b64),
|
||||
|
||||
Reference in new issue
Block a user