Defer the pending article page flush until the swipe transition has finished, to avoid a UIKit assertion crash. Fixes #5384.

This commit is contained in:
Brent Simmons committed 2026-08-05 09:37:56 -07:00
1 parent d1829e4983
commit 00efcc2bcf
1 file changed
+9 -1
+9 -1
View File
@@ -525,7 +525,15 @@ extension ArticleViewController: UIPageViewControllerDelegate {
if let pending = pendingSetViewController {
pendingSetViewController = nil
pageViewController.setViewControllers([pending], direction: .forward, animated: false, completion: nil)
// Async because UIKit is still finishing the swipe — a synchronous
// setViewControllers here triggers an assertion in _UIQueuingScrollView.
DispatchQueue.main.async {
if self.isPageTransitionInProgress {
self.pendingSetViewController = pending
} else {
self.pageViewController.setViewControllers([pending], direction: .forward, animated: false, completion: nil)
}
}
}
guard finished, completed else { return }