From ce90c7390fe721d409d1ca37bec2e6c0e1c2c793 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 31 Oct 2026 15:45:41 -0700 Subject: [PATCH] Remove some unused code. --- .../MainTimelineViewController.swift | 22 +------------------ iOS/SceneCoordinator.swift | 3 --- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift index d570ff9de..7d53c118e 100644 --- a/iOS/MainTimeline/MainTimelineViewController.swift +++ b/iOS/MainTimeline/MainTimelineViewController.swift @@ -52,15 +52,6 @@ final class MainTimelineViewController: UIViewController, UndoableCommandRunner return coordinator?.currentArticle } - private var timelineMiddleIndexPath: IndexPath? { - get { - coordinator?.timelineMiddleIndexPath - } - set { - coordinator?.timelineMiddleIndexPath = newValue - } - } - private var isTimelineViewControllerPending: Bool { get { coordinator?.isTimelineViewControllerPending ?? false @@ -175,7 +166,6 @@ final class MainTimelineViewController: UIViewController, UndoableCommandRunner private static let cellReloadDelay: TimeInterval = 0.1 // MARK: Constants - private let scrollPositionQueue = CoalescingQueue(name: "Timeline Scroll Position", interval: 0.3, maxInterval: 1.0) private let updateQueue = CoalescingQueue(name: "Timeline Update Queue", interval: 0.5, maxInterval: 1.0) // MARK: - IBOutlets @@ -208,12 +198,7 @@ final class MainTimelineViewController: UIViewController, UndoableCommandRunner configureToolbar() resetUI(resetScroll: true) - // Load the table and then scroll to the saved position if available - applyChanges(animated: false) { - if let restoreIndexPath = self.timelineMiddleIndexPath { - self.collectionView?.scrollToItem(at: restoreIndexPath, at: .centeredVertically, animated: false) - } - } + applyChanges(animated: false) // Disable swipe back on iPad Mice guard let gesture = self.navigationController?.interactivePopGestureRecognizer as? UIPanGestureRecognizer else { @@ -1305,11 +1290,6 @@ private extension MainTimelineViewController { SingleLineUILabelSizer.emptyCache() } - @objc func scrollPositionDidChange() { - Self.logger.debug("MainTimelineViewController: scrollPositionDidChange") - timelineMiddleIndexPath = collectionView?.middleVisibleRow() - } - } extension MainTimelineViewController: UISearchControllerDelegate { diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 8bb593a7d..29f4de5b1 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -171,8 +171,6 @@ struct SidebarItemNode: Hashable, Sendable { } } - var timelineMiddleIndexPath: IndexPath? - private(set) var showFeedNames = ShowFeedName.none private(set) var showIcons = false @@ -275,7 +273,6 @@ struct SidebarItemNode: Hashable, Sendable { private(set) var articles = ArticleArray() { didSet { - timelineMiddleIndexPath = nil articleDictionaryNeedsUpdate = true } }