mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix lint issues.
This commit is contained in:
@@ -293,7 +293,11 @@ private extension MainTimelineTableViewCell {
|
||||
}
|
||||
|
||||
func showOrHideView(_ view: UIView, _ shouldHide: Bool) {
|
||||
shouldHide ? hideView(view) : showView(view)
|
||||
if shouldHide {
|
||||
hideView(view)
|
||||
} else {
|
||||
showView(view)
|
||||
}
|
||||
}
|
||||
|
||||
func updateSubviews() {
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
// swiftlint:disable:next line_length
|
||||
class MainTimelineDataSource<SectionIdentifierType, ItemIdentifierType>: UITableViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType> where SectionIdentifierType: Hashable, ItemIdentifierType: Hashable {
|
||||
|
||||
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ class MainTimelineTitleView: UIView {
|
||||
}()
|
||||
|
||||
override var accessibilityLabel: String? {
|
||||
set { }
|
||||
get {
|
||||
if let name = label.text {
|
||||
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessibility")
|
||||
@@ -28,6 +27,8 @@ class MainTimelineTitleView: UIView {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
set {
|
||||
}
|
||||
}
|
||||
|
||||
func buttonize() {
|
||||
@@ -47,8 +48,8 @@ extension MainTimelineTitleView: UIPointerInteractionDelegate {
|
||||
|
||||
func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? {
|
||||
var rect = self.frame
|
||||
rect.origin.x = rect.origin.x - 10
|
||||
rect.size.width = rect.width + 20
|
||||
rect.origin.x -= 10
|
||||
rect.size.width += 20
|
||||
|
||||
return UIPointerStyle(effect: .automatic(UITargetedPreview(view: self)), shape: .roundedRect(rect))
|
||||
}
|
||||
|
||||
@@ -16,12 +16,14 @@ extension UIBarButtonItem: MarkAsReadAlertControllerSourceType {}
|
||||
|
||||
struct MarkAsReadAlertController {
|
||||
|
||||
static func confirm<T>(_ controller: UIViewController?,
|
||||
coordinator: SceneCoordinator?,
|
||||
confirmTitle: String,
|
||||
sourceType: T,
|
||||
cancelCompletion: (() -> Void)? = nil,
|
||||
completion: @escaping () -> Void) where T: MarkAsReadAlertControllerSourceType {
|
||||
static func confirm<T>(
|
||||
_ controller: UIViewController?,
|
||||
coordinator: SceneCoordinator?,
|
||||
confirmTitle: String,
|
||||
sourceType: T,
|
||||
cancelCompletion: (() -> Void)? = nil,
|
||||
completion: @escaping () -> Void
|
||||
) where T: MarkAsReadAlertControllerSourceType {
|
||||
|
||||
guard let controller = controller, let coordinator = coordinator else {
|
||||
completion()
|
||||
@@ -38,11 +40,13 @@ struct MarkAsReadAlertController {
|
||||
}
|
||||
}
|
||||
|
||||
private static func alert<T>(coordinator: SceneCoordinator,
|
||||
confirmTitle: String,
|
||||
cancelCompletion: (() -> Void)?,
|
||||
sourceType: T,
|
||||
completion: @escaping (UIAlertAction) -> Void) -> UIAlertController where T: MarkAsReadAlertControllerSourceType {
|
||||
private static func alert<T>(
|
||||
coordinator: SceneCoordinator,
|
||||
confirmTitle: String,
|
||||
cancelCompletion: (() -> Void)?,
|
||||
sourceType: T,
|
||||
completion: @escaping (UIAlertAction) -> Void
|
||||
) -> UIAlertController where T: MarkAsReadAlertControllerSourceType {
|
||||
|
||||
let title = NSLocalizedString("Mark As Read", comment: "Mark As Read")
|
||||
let message = NSLocalizedString("You can turn this confirmation off in Settings.",
|
||||
|
||||
@@ -563,7 +563,23 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
|
||||
let prototypeID = "prototype"
|
||||
let status = ArticleStatus(articleID: prototypeID, read: false, starred: false, dateArrived: Date())
|
||||
let prototypeArticle = Article(accountID: prototypeID, articleID: prototypeID, feedID: prototypeID, uniqueID: prototypeID, title: Constants.prototypeText, contentHTML: nil, contentText: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, datePublished: nil, dateModified: nil, authors: nil, status: status)
|
||||
let prototypeArticle = Article(
|
||||
accountID: prototypeID,
|
||||
articleID: prototypeID,
|
||||
feedID: prototypeID,
|
||||
uniqueID: prototypeID,
|
||||
title: Constants.prototypeText,
|
||||
contentHTML: nil,
|
||||
contentText: nil,
|
||||
url: nil,
|
||||
externalURL: nil,
|
||||
summary: nil,
|
||||
imageURL: nil,
|
||||
datePublished: nil,
|
||||
dateModified: nil,
|
||||
authors: nil,
|
||||
status: status
|
||||
)
|
||||
|
||||
let prototypeCellData = MainTimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Prototype Feed Name", byline: nil, iconImage: nil, showIcon: false, numberOfLines: numberOfTextLines, iconSize: iconSize)
|
||||
|
||||
@@ -574,9 +590,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||
let layout = MainTimelineDefaultCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData)
|
||||
tableView.estimatedRowHeight = layout.height
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: Searching
|
||||
|
||||
Reference in New Issue
Block a user