diff --git a/Shared/Widget/WidgetDataEncoder.swift b/Shared/Widget/WidgetDataEncoder.swift index c13021dc1..8829d3cb4 100644 --- a/Shared/Widget/WidgetDataEncoder.swift +++ b/Shared/Widget/WidgetDataEncoder.swift @@ -139,7 +139,7 @@ import Account starredArticles: starredArticles, todayArticles: todayArticles, lastUpdateTime: Date.now) - + return latestData } diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 7029c8c4e..3181640eb 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -446,4 +446,3 @@ private extension AppDelegate { } } } - diff --git a/iOS/MainFeed/MainFeedCollectionViewController+Drag.swift b/iOS/MainFeed/MainFeedCollectionViewController+Drag.swift index 8dd83b29a..82222de11 100644 --- a/iOS/MainFeed/MainFeedCollectionViewController+Drag.swift +++ b/iOS/MainFeed/MainFeedCollectionViewController+Drag.swift @@ -37,4 +37,3 @@ extension MainFeedCollectionViewController: UICollectionViewDragDelegate { return [dragItem] } } - diff --git a/iOS/MainTimeline/Cells/MainTimelineFeedCell.swift b/iOS/MainTimeline/Cells/MainTimelineFeedCell.swift index b88558773..8a027606c 100644 --- a/iOS/MainTimeline/Cells/MainTimelineFeedCell.swift +++ b/iOS/MainTimeline/Cells/MainTimelineFeedCell.swift @@ -105,9 +105,9 @@ class MainTimelineFeedCell: UITableViewCell { let titleAttributed = NSAttributedString(string: cellData.title, attributes: titleAttributes) attributedCellText.append(titleAttributed) } - + articleTitle.attributedText = attributedCellText - + if linesUsedForTitleGreaterThanOrEqualToPreference() { // No need to add cell summary as we're already at maximum. articleTitle.lineBreakMode = .byTruncatingTail @@ -136,10 +136,10 @@ class MainTimelineFeedCell: UITableViewCell { } } } - + func linesUsedForTitleGreaterThanOrEqualToPreference() -> Bool { contentView.layoutIfNeeded() - + let attributed = articleTitle.attributedText ?? NSAttributedString() let textStorage = NSTextStorage(attributedString: attributed) let containerSize = CGSize(width: articleTitle.bounds.width, height: .greatestFiniteMagnitude) @@ -191,4 +191,3 @@ class MainTimelineFeedCell: UITableViewCell { self.backgroundConfiguration = backgroundConfig } } - diff --git a/iOS/MainTimeline/Cells/MainTimelineIconFeedCell.swift b/iOS/MainTimeline/Cells/MainTimelineIconFeedCell.swift index 8f82c90d3..fbdcd042e 100644 --- a/iOS/MainTimeline/Cells/MainTimelineIconFeedCell.swift +++ b/iOS/MainTimeline/Cells/MainTimelineIconFeedCell.swift @@ -15,7 +15,7 @@ class MainTimelineIconFeedCell: UITableViewCell { @IBOutlet var indicatorView: IconView! @IBOutlet var articleDate: UILabel! @IBOutlet var metaDataStackView: UIStackView! - + private(set) var usedTitleLineCount: Int = 0 var cellData: MainTimelineCellData! { @@ -130,9 +130,9 @@ class MainTimelineIconFeedCell: UITableViewCell { let titleAttributed = NSAttributedString(string: cellData.title, attributes: titleAttributes) attributedCellText.append(titleAttributed) } - + articleTitle.attributedText = attributedCellText - + if linesUsedForTitleGreaterThanOrEqualToPreference() { // No need to add cell summary as we're already at maximum. articleTitle.lineBreakMode = .byTruncatingTail @@ -161,10 +161,10 @@ class MainTimelineIconFeedCell: UITableViewCell { } } } - + func linesUsedForTitleGreaterThanOrEqualToPreference() -> Bool { contentView.layoutIfNeeded() - + let attributed = articleTitle.attributedText ?? NSAttributedString() let textStorage = NSTextStorage(attributedString: attributed) let containerSize = CGSize(width: articleTitle.bounds.width, height: .greatestFiniteMagnitude) diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift index 6e61db2b6..c8885ee5f 100644 --- a/iOS/MainTimeline/MainTimelineViewController.swift +++ b/iOS/MainTimeline/MainTimelineViewController.swift @@ -564,7 +564,7 @@ final class MainTimelineViewController: UITableViewController, UndoableCommandRu let cell = tableView.cellForRow(at: IndexPath(row: row, section: 0)), let _ = view.window else { return nil } - + let previewView = cell.contentView let inset: CGFloat = 0 let visibleBounds = previewView.bounds.insetBy(dx: inset, dy: 2)