diff --git a/iOS/MainFeed/Cell/MainFeedTableViewCell.swift b/iOS/MainFeed/Cell/MainFeedTableViewCell.swift index 4c909cfa2..04f4604ee 100644 --- a/iOS/MainFeed/Cell/MainFeedTableViewCell.swift +++ b/iOS/MainFeed/Cell/MainFeedTableViewCell.swift @@ -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) } diff --git a/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift b/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift index 037d4fb0e..69fc5da0d 100644 --- a/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift +++ b/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift @@ -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 { diff --git a/iOS/MainTimeline/TimelineViewController.swift b/iOS/MainTimeline/TimelineViewController.swift index 017dc2e7c..cc0d35bac 100644 --- a/iOS/MainTimeline/TimelineViewController.swift +++ b/iOS/MainTimeline/TimelineViewController.swift @@ -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