Fix lint issues.

This commit is contained in:
Brent Simmons
2025-01-23 22:52:36 -08:00
parent ae2b017ae0
commit 4b1b285d0b
19 changed files with 98 additions and 43 deletions

View File

@@ -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() {

View File

@@ -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
}
}

View File

@@ -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))
}

View File

@@ -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.",

View File

@@ -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