From ee81553bf5b98d9197d5ea6b0fd264b25c3c567c Mon Sep 17 00:00:00 2001 From: Joe Masilotti Date: Tue, 7 Nov 2023 11:37:24 -0800 Subject: [PATCH] Convenience initializer to not expose Session --- Sources/TurboNavigator.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/TurboNavigator.swift b/Sources/TurboNavigator.swift index 9719159..8978a5d 100644 --- a/Sources/TurboNavigator.swift +++ b/Sources/TurboNavigator.swift @@ -27,6 +27,16 @@ public class TurboNavigator: TurboNavigationHierarchyControllerDelegate { defer { self.webkitUIDelegate = TurboWKUIController(delegate: self) } } + public convenience init(pathConfiguration: PathConfiguration, delegate: TurboNavigatorDelegate? = nil) { + let session = Session() + session.pathConfiguration = pathConfiguration + + let modalSession = Session() + session.pathConfiguration = pathConfiguration + + self.init(session: session, modalSession: modalSession, delegate: delegate) + } + /// Transforms `URL` -> `VisitProposal` -> `UIViewController`. /// Given the `VisitProposal`'s properties, push or present this view controller. ///