From 57668886b28842a43ff5ce4b0064ad4455306c6f Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 6 Dec 2022 21:46:32 -0500 Subject: [PATCH] Fix crash when scrolling through Local/Federated timeline with VoiceOver It seems that the accessibility scroll mechanism does something like: 1. Find the next IndexPath to focus 2. Scroll to make it visible 3. Focus that cell But because the timeline description cell is removed during the scroll, the IndexPath that the accessibility system wants to focus becomes invalid between steps 2 and 3, causing a crash when trying to focus it. As a workaround, only remove the timeline description _item_ rather than the header section so that section indices aren't affected. Closes #290 --- Tusker/Screens/Timeline/TimelineViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index 030baf35..01ad78df 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -345,7 +345,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro private func removeTimelineDescriptionCell() { var snapshot = dataSource.snapshot() - snapshot.deleteSections([.header]) + snapshot.deleteItems([.publicTimelineDescription]) dataSource.apply(snapshot, animatingDifferences: true) isShowingTimelineDescription = false }