Invalidate user activities when collapsed and returning to Feeds scene

This commit is contained in:
Maurice Parker
2019-09-01 15:31:11 -05:00
parent 1a9acdcc50
commit 189af8d816
2 changed files with 18 additions and 0 deletions

View File

@@ -253,6 +253,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
rootSplitViewController.delegate = self
masterNavigationController = (rootSplitViewController.viewControllers.first as! UINavigationController)
masterNavigationController.delegate = self
masterFeedViewController = UIStoryboard.main.instantiateController(ofType: MasterFeedViewController.self)
masterFeedViewController.coordinator = self
@@ -784,6 +785,16 @@ extension SceneCoordinator: UISplitViewControllerDelegate {
}
// MARK: UINavigationControllerDelegate
extension SceneCoordinator: UINavigationControllerDelegate {
func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
if rootSplitViewController.isCollapsed && viewController === masterFeedViewController {
activityManager.invalidateCurrentActivities()
}
}
}
// MARK: Private
private extension SceneCoordinator {