From 61370dd04d9ad38cc9bd9cb50140adeaa7e84719 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 24 Dec 2019 17:34:47 -0700 Subject: [PATCH] Fix so that we don't try to scroll before the datasource has been fully applied to the table. Issue #1463 --- iOS/MasterTimeline/MasterTimelineViewController.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 3d8ce6479..709e1f117 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -74,11 +74,12 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner } resetUI(resetScroll: true) - applyChanges(animated: false) - // Restore the scroll position if we have one stored - if let restoreIndexPath = coordinator.timelineMiddleIndexPath { - tableView.scrollToRow(at: restoreIndexPath, at: .middle, animated: false) + // Load the table and then scroll to the saved position if available + applyChanges(animated: false) { + if let restoreIndexPath = self.coordinator.timelineMiddleIndexPath { + self.tableView.scrollToRow(at: restoreIndexPath, at: .middle, animated: false) + } } }