Fixed timeline loading bug for portrait on the iPad

This commit is contained in:
Maurice Parker 2019-09-11 10:41:48 -05:00
parent d8b7d603bf
commit 856006a19f
2 changed files with 2 additions and 2 deletions

View File

@ -68,13 +68,13 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
numberOfTextLines = AppDefaults.timelineNumberOfLines numberOfTextLines = AppDefaults.timelineNumberOfLines
resetEstimatedRowHeight() resetEstimatedRowHeight()
applyChanges(animate: false)
resetUI() resetUI()
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
clearsSelectionOnViewWillAppear = coordinator.isRootSplitCollapsed clearsSelectionOnViewWillAppear = coordinator.isRootSplitCollapsed
applyChanges(animate: false)
super.viewWillAppear(animated) super.viewWillAppear(animated)
} }
@ -495,6 +495,7 @@ private extension MasterTimelineViewController {
var snapshot = NSDiffableDataSourceSnapshot<Int, Article>() var snapshot = NSDiffableDataSourceSnapshot<Int, Article>()
snapshot.appendSections([0]) snapshot.appendSections([0])
snapshot.appendItems(coordinator.articles, toSection: 0) snapshot.appendItems(coordinator.articles, toSection: 0)
print("********* article count: \(coordinator.articles.count)")
dataSource.apply(snapshot, animatingDifferences: animate) { [weak self] in dataSource.apply(snapshot, animatingDifferences: animate) { [weak self] in
self?.restoreSelectionIfNecessary() self?.restoreSelectionIfNecessary()

View File

@ -1571,7 +1571,6 @@ private extension SceneCoordinator {
let timelineController = UIStoryboard.main.instantiateController(ofType: MasterTimelineViewController.self) let timelineController = UIStoryboard.main.instantiateController(ofType: MasterTimelineViewController.self)
timelineController.coordinator = self timelineController.coordinator = self
masterNavigationController.pushViewController(timelineController, animated: false) masterNavigationController.pushViewController(timelineController, animated: false)
timelineController.restoreSelectionIfNecessary()
} }
// Pull the detail or no selection controller out of the sub split second position and move it to the root split controller // Pull the detail or no selection controller out of the sub split second position and move it to the root split controller