From 820cfa912fab39b7f29e092479f5efbba156b518 Mon Sep 17 00:00:00 2001 From: Fernando Olivares Date: Fri, 26 Apr 2024 22:05:01 -0600 Subject: [PATCH 1/3] Add bundle parameter to route --- Source/Turbo Navigator/TurboNavigator.swift | 5 +++-- Source/Visit/VisitProposal.swift | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Turbo Navigator/TurboNavigator.swift b/Source/Turbo Navigator/TurboNavigator.swift index 74b715e..5c9c1be 100644 --- a/Source/Turbo Navigator/TurboNavigator.swift +++ b/Source/Turbo Navigator/TurboNavigator.swift @@ -42,10 +42,11 @@ public class TurboNavigator { /// Convenience function to routing a proposal directly. /// /// - Parameter url: the URL to visit - public func route(_ url: URL) { + /// - Parameter bundle: provide context relevant to `url` + public func route(_ url: URL, bundle: [String: Any]? = nil) { let options = VisitOptions(action: .advance, response: nil) let properties = session.pathConfiguration?.properties(for: url) ?? PathProperties() - route(VisitProposal(url: url, options: options, properties: properties)) + route(VisitProposal(url: url, options: options, properties: properties, bundle: bundle)) } /// Transforms `VisitProposal` -> `UIViewController` diff --git a/Source/Visit/VisitProposal.swift b/Source/Visit/VisitProposal.swift index 32d8237..7db06a0 100644 --- a/Source/Visit/VisitProposal.swift +++ b/Source/Visit/VisitProposal.swift @@ -4,10 +4,15 @@ public struct VisitProposal { public let url: URL public let options: VisitOptions public let properties: PathProperties + public let bundle: [String: Any]? - public init(url: URL, options: VisitOptions, properties: PathProperties = [:]) { + public init(url: URL, + options: VisitOptions, + properties: PathProperties = [:], + bundle: [String: Any]? = nil) { self.url = url self.options = options self.properties = properties + self.bundle = bundle } } From a242deb9aaa0c3c3c68c01215bf5187a6cc24933 Mon Sep 17 00:00:00 2001 From: Fernando Olivares Date: Thu, 9 May 2024 16:02:18 -0600 Subject: [PATCH 2/3] Rename to parameters --- Source/Turbo Navigator/TurboNavigator.swift | 4 ++-- Source/Visit/VisitProposal.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Turbo Navigator/TurboNavigator.swift b/Source/Turbo Navigator/TurboNavigator.swift index 5c9c1be..d59aafc 100644 --- a/Source/Turbo Navigator/TurboNavigator.swift +++ b/Source/Turbo Navigator/TurboNavigator.swift @@ -43,10 +43,10 @@ public class TurboNavigator { /// /// - Parameter url: the URL to visit /// - Parameter bundle: provide context relevant to `url` - public func route(_ url: URL, bundle: [String: Any]? = nil) { + public func route(_ url: URL, parameters: [String: Any]? = nil) { let options = VisitOptions(action: .advance, response: nil) let properties = session.pathConfiguration?.properties(for: url) ?? PathProperties() - route(VisitProposal(url: url, options: options, properties: properties, bundle: bundle)) + route(VisitProposal(url: url, options: options, properties: properties, parameters: parameters)) } /// Transforms `VisitProposal` -> `UIViewController` diff --git a/Source/Visit/VisitProposal.swift b/Source/Visit/VisitProposal.swift index 7db06a0..34e0583 100644 --- a/Source/Visit/VisitProposal.swift +++ b/Source/Visit/VisitProposal.swift @@ -4,15 +4,15 @@ public struct VisitProposal { public let url: URL public let options: VisitOptions public let properties: PathProperties - public let bundle: [String: Any]? + public let parameters: [String: Any]? public init(url: URL, options: VisitOptions, properties: PathProperties = [:], - bundle: [String: Any]? = nil) { + parameters: [String: Any]? = nil) { self.url = url self.options = options self.properties = properties - self.bundle = bundle + self.parameters = parameters } } From a95d7c16db3e20b70cd32b93dd028bcef27ab935 Mon Sep 17 00:00:00 2001 From: Fernando Olivares Date: Thu, 9 May 2024 16:02:47 -0600 Subject: [PATCH 3/3] Rename code comment --- Source/Turbo Navigator/TurboNavigator.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Turbo Navigator/TurboNavigator.swift b/Source/Turbo Navigator/TurboNavigator.swift index d59aafc..8153cc5 100644 --- a/Source/Turbo Navigator/TurboNavigator.swift +++ b/Source/Turbo Navigator/TurboNavigator.swift @@ -42,7 +42,7 @@ public class TurboNavigator { /// Convenience function to routing a proposal directly. /// /// - Parameter url: the URL to visit - /// - Parameter bundle: provide context relevant to `url` + /// - Parameter parameters: provide context relevant to `url` public func route(_ url: URL, parameters: [String: Any]? = nil) { let options = VisitOptions(action: .advance, response: nil) let properties = session.pathConfiguration?.properties(for: url) ?? PathProperties()