Skip to content

Commit

Permalink
Prevent public enum from having the same name as the framework
Browse files Browse the repository at this point in the history
  • Loading branch information
olivaresf committed Nov 17, 2023
1 parent 5894d0f commit 4f9c29a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
#if DEBUG
Turbo.config.debugLoggingEnabled = true
TurboConfig.shared.debugLoggingEnabled = true
Strada.config.debugLoggingEnabled = true
#endif

Expand Down
4 changes: 2 additions & 2 deletions Source/Turbo Navigator/TurboNavigator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public class TurboNavigator {
/// - pathConfiguration: an optional remote configuration reference
/// - delegate: an optional delegate to handle custom view controllers
public convenience init(pathConfiguration: PathConfiguration? = nil, delegate: TurboNavigatorDelegate? = nil) {
let session = Session(webView: Turbo.config.makeWebView())
let session = Session(webView: TurboConfig.shared.makeWebView())
session.pathConfiguration = pathConfiguration

let modalSession = Session(webView: Turbo.config.makeWebView())
let modalSession = Session(webView: TurboConfig.shared.makeWebView())
modalSession.pathConfiguration = pathConfiguration

self.init(session: session, modalSession: modalSession, delegate: delegate)
Expand Down
9 changes: 5 additions & 4 deletions Source/Turbo.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import WebKit

public enum Turbo {
public static var config = TurboConfig()
}

public class TurboConfig {

public static let shared = TurboConfig()

private init() { }

public typealias WebViewBlock = (_ configuration: WKWebViewConfiguration) -> WKWebView

/// Override to set a custom user agent.
Expand Down

0 comments on commit 4f9c29a

Please sign in to comment.