Fix lint issues.

This commit is contained in:
Brent Simmons 2025-01-24 21:57:34 -08:00
parent 4fabcab999
commit 6923695b37
3 changed files with 35 additions and 12 deletions

View File

@ -28,6 +28,8 @@ class MainFeedTableViewCell: VibrantTableViewCell {
return name
}
}
set {
}
}
var iconImage: IconImage? {
@ -131,13 +133,26 @@ class MainFeedTableViewCell: VibrantTableViewCell {
}
override func sizeThatFits(_ size: CGSize) -> CGSize {
let layout = MainFeedTableViewCellLayout(cellWidth: bounds.size.width, insets: safeAreaInsets, label: titleView, unreadCountView: unreadCountView, showingEditingControl: isShowingEditControl, indent: indentationLevel == 1, shouldShowDisclosure: isDisclosureAvailable)
let layout = MainFeedTableViewCellLayout(
cellWidth: bounds.size.width,
insets: safeAreaInsets,
label: titleView,
unreadCountView: unreadCountView,
showingEditingControl: isShowingEditControl,
indent: indentationLevel == 1,
shouldShowDisclosure: isDisclosureAvailable
)
return CGSize(width: bounds.width, height: layout.height)
}
override func layoutSubviews() {
super.layoutSubviews()
let layout = MainFeedTableViewCellLayout(cellWidth: bounds.size.width, insets: safeAreaInsets, label: titleView, unreadCountView: unreadCountView, showingEditingControl: isShowingEditControl, indent: indentationLevel == 1, shouldShowDisclosure: isDisclosureAvailable)
let layout = MainFeedTableViewCellLayout(cellWidth: bounds.size.width, insets: safeAreaInsets, label: titleView,
unreadCountView: unreadCountView,
showingEditingControl: isShowingEditControl,
indent: indentationLevel == 1,
shouldShowDisclosure: isDisclosureAvailable
)
layoutWith(layout)
}

View File

@ -25,15 +25,15 @@ class MainFeedTableViewSectionHeader: UITableViewHeaderFooterView {
return "\(name) \(expandedStateMessage) "
}
}
set {
}
}
private var expandedStateMessage: String {
get {
if disclosureExpanded {
return NSLocalizedString("Expanded", comment: "Disclosure button expanded state for accessibility")
}
return NSLocalizedString("Collapsed", comment: "Disclosure button collapsed state for accessibility")
if disclosureExpanded {
return NSLocalizedString("Expanded", comment: "Disclosure button expanded state for accessibility")
}
return NSLocalizedString("Collapsed", comment: "Disclosure button collapsed state for accessibility")
}
var unreadCount: Int {

View File

@ -163,7 +163,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
}
}
if let _ = sender as? UIKeyCommand {
if sender is UIKeyCommand {
guard let indexPath = tableView.indexPathForSelectedRow, let contentView = tableView.cellForRow(at: indexPath)?.contentView else {
return
}
@ -766,8 +766,16 @@ private extension TimelineViewController {
let showFeedNames = coordinator.showFeedNames
let showIcon = coordinator.showIcons && iconImage != nil
cell.cellData = MainTimelineCellData(article: article, showFeedName: showFeedNames, feedName: article.feed?.nameForDisplay, byline: article.byline(), iconImage: iconImage, showIcon: showIcon, numberOfLines: numberOfTextLines, iconSize: iconSize)
cell.cellData = MainTimelineCellData(
article: article,
showFeedName: showFeedNames,
feedName: article.feed?.nameForDisplay,
byline: article.byline(),
iconImage: iconImage,
showIcon: showIcon,
numberOfLines: numberOfTextLines,
iconSize: iconSize
)
}
func iconImageFor(_ article: Article) -> IconImage? {
@ -964,7 +972,7 @@ private extension TimelineViewController {
}
func openInBrowserAction(_ article: Article) -> UIAction? {
guard let _ = article.preferredURL else { return nil }
guard article.preferredURL != nil else { return nil }
let title = NSLocalizedString("Open in Browser", comment: "Open in Browser")
let action = UIAction(title: title, image: AppAssets.safariImage) { [weak self] _ in
self?.coordinator.showBrowserForArticle(article)
@ -973,7 +981,7 @@ private extension TimelineViewController {
}
func openInBrowserAlertAction(_ article: Article, completion: @escaping (Bool) -> Void) -> UIAlertAction? {
guard let _ = article.preferredURL else { return nil }
guard article.preferredURL != nil else { return nil }
let title = NSLocalizedString("Open in Browser", comment: "Open in Browser")
let action = UIAlertAction(title: title, style: .default) { [weak self] _ in