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 return name
} }
} }
set {
}
} }
var iconImage: IconImage? { var iconImage: IconImage? {
@ -131,13 +133,26 @@ class MainFeedTableViewCell: VibrantTableViewCell {
} }
override func sizeThatFits(_ size: CGSize) -> CGSize { 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) return CGSize(width: bounds.width, height: layout.height)
} }
override func layoutSubviews() { override func layoutSubviews() {
super.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) layoutWith(layout)
} }

View File

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

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 { guard let indexPath = tableView.indexPathForSelectedRow, let contentView = tableView.cellForRow(at: indexPath)?.contentView else {
return return
} }
@ -766,8 +766,16 @@ private extension TimelineViewController {
let showFeedNames = coordinator.showFeedNames let showFeedNames = coordinator.showFeedNames
let showIcon = coordinator.showIcons && iconImage != nil 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? { func iconImageFor(_ article: Article) -> IconImage? {
@ -964,7 +972,7 @@ private extension TimelineViewController {
} }
func openInBrowserAction(_ article: Article) -> UIAction? { 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 title = NSLocalizedString("Open in Browser", comment: "Open in Browser")
let action = UIAction(title: title, image: AppAssets.safariImage) { [weak self] _ in let action = UIAction(title: title, image: AppAssets.safariImage) { [weak self] _ in
self?.coordinator.showBrowserForArticle(article) self?.coordinator.showBrowserForArticle(article)
@ -973,7 +981,7 @@ private extension TimelineViewController {
} }
func openInBrowserAlertAction(_ article: Article, completion: @escaping (Bool) -> Void) -> UIAlertAction? { 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 title = NSLocalizedString("Open in Browser", comment: "Open in Browser")
let action = UIAlertAction(title: title, style: .default) { [weak self] _ in let action = UIAlertAction(title: title, style: .default) { [weak self] _ in