From 43d4c4e082c4c8d17e46a074e4d19e68c9d7749e Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Wed, 20 Oct 2021 08:57:19 +0200 Subject: [PATCH] SplitViewPresentable: Add possiblity to reset detail stack. --- Riot/Modules/SplitView/SplitViewCoordinator.swift | 4 ++++ Riot/Modules/SplitView/SplitViewPresentable.swift | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Riot/Modules/SplitView/SplitViewCoordinator.swift b/Riot/Modules/SplitView/SplitViewCoordinator.swift index 1fd948dd0..479ebf702 100644 --- a/Riot/Modules/SplitView/SplitViewCoordinator.swift +++ b/Riot/Modules/SplitView/SplitViewCoordinator.swift @@ -351,4 +351,8 @@ extension SplitViewCoordinator: SplitViewMasterPresentableDelegate { detailNavigationRouter.push(detailPresentable, animated: true, popCompletion: popCompletion) } + + func splitViewMasterPresentableWantsToResetDetail(_ presentable: Presentable) { + self.resetDetailNavigationControllerWithPlaceholder(animated: false) + } } diff --git a/Riot/Modules/SplitView/SplitViewPresentable.swift b/Riot/Modules/SplitView/SplitViewPresentable.swift index 3521c76bd..7932a4815 100644 --- a/Riot/Modules/SplitView/SplitViewPresentable.swift +++ b/Riot/Modules/SplitView/SplitViewPresentable.swift @@ -26,6 +26,9 @@ protocol SplitViewMasterPresentableDelegate: AnyObject { /// Stack the detailPresentable on the existing split view detail stack func splitViewMasterPresentable(_ presentable: Presentable, wantsToStack detailPresentable: Presentable, popCompletion: (() -> Void)?) + + /// Reset detail stack with placeholder + func splitViewMasterPresentableWantsToResetDetail(_ presentable: Presentable) } /// `SplitViewMasterPresentableDelegate` default implementation