Skip to content

Commit

Permalink
Add bundle parameter to route
Browse files Browse the repository at this point in the history
  • Loading branch information
olivaresf committed Apr 27, 2024
1 parent 15a9958 commit 820cfa9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Source/Turbo Navigator/TurboNavigator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
7 changes: 6 additions & 1 deletion Source/Visit/VisitProposal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 820cfa9

Please sign in to comment.