SplitViewCoordinator: Add possibility to stack controllers on detail view.

This commit is contained in:
SBiOSoftWhare
2021-10-06 17:20:34 +02:00
parent cb8fc6213e
commit cf29bd6adb
3 changed files with 22 additions and 6 deletions
@@ -17,15 +17,21 @@
import UIKit
protocol SplitViewMasterPresentableDelegate: AnyObject {
func splitViewMasterPresentable(_ presentable: Presentable, wantsToDisplay detailPresentable: Presentable, popCompletion: (() -> Void)?)
/// Detail items from the split view
var detailModules: [Presentable] { get }
/// Replace split view detail with the given detailPresentable
func splitViewMasterPresentable(_ presentable: Presentable, wantsToReplaceDetailWith detailPresentable: Presentable, popCompletion: (() -> Void)?)
/// Stack the detailPresentable on the existing split view detail stack
func splitViewMasterPresentable(_ presentable: Presentable, wantsToStack detailPresentable: Presentable, popCompletion: (() -> Void)?)
}
/// `SplitViewMasterPresentableDelegate` default implementation
extension SplitViewMasterPresentableDelegate {
func splitViewMasterPresentable(_ presentable: Presentable, wantsToDisplay detailPresentable: Presentable) {
splitViewMasterPresentable(presentable, wantsToDisplay: detailPresentable, popCompletion: nil)
splitViewMasterPresentable(presentable, wantsToReplaceDetailWith: detailPresentable, popCompletion: nil)
}
}