diff --git a/Samples/MobileBuyIntegration/MobileBuyIntegration/AppDelegate.swift b/Samples/MobileBuyIntegration/MobileBuyIntegration/AppDelegate.swift index 45a15d92..8abc9aed 100644 --- a/Samples/MobileBuyIntegration/MobileBuyIntegration/AppDelegate.swift +++ b/Samples/MobileBuyIntegration/MobileBuyIntegration/AppDelegate.swift @@ -33,7 +33,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { $0.colorScheme = .automatic /// Enable preloading - $0.preloading.enabled = true + $0.preloading.enabled = false + + $0.progressBarEnabled = true /// Optional logger used for internal purposes $0.logger = FileLogger("log.txt") diff --git a/Sources/ShopifyCheckoutSheetKit/CheckoutWebView.swift b/Sources/ShopifyCheckoutSheetKit/CheckoutWebView.swift index ee963433..87bf786f 100644 --- a/Sources/ShopifyCheckoutSheetKit/CheckoutWebView.swift +++ b/Sources/ShopifyCheckoutSheetKit/CheckoutWebView.swift @@ -154,6 +154,13 @@ class CheckoutWebView: WKWebView { injectionTime: WKUserScriptInjectionTime.atDocumentStart, forMainFrameOnly: true )) + + isOpaque = false + backgroundColor = ShopifyCheckoutSheetKit.configuration.backgroundColor + + if #available(iOS 15.0, *) { + underPageBackgroundColor = ShopifyCheckoutSheetKit.configuration.backgroundColor + } } deinit { diff --git a/Sources/ShopifyCheckoutSheetKit/CheckoutWebViewController.swift b/Sources/ShopifyCheckoutSheetKit/CheckoutWebViewController.swift index 21ce9bc4..4e20415c 100644 --- a/Sources/ShopifyCheckoutSheetKit/CheckoutWebViewController.swift +++ b/Sources/ShopifyCheckoutSheetKit/CheckoutWebViewController.swift @@ -72,6 +72,8 @@ class CheckoutWebViewController: UIViewController, UIAdaptivePresentationControl navigationItem.rightBarButtonItem = closeBarButtonItem checkoutView.viewDelegate = self + + view.backgroundColor = ShopifyCheckoutSheetKit.configuration.backgroundColor } required init?(coder: NSCoder) { @@ -86,11 +88,13 @@ class CheckoutWebViewController: UIViewController, UIAdaptivePresentationControl // MARK: UIViewController Lifecycle + override public func viewWillAppear(_ animated: Bool) { + view.backgroundColor = ShopifyCheckoutSheetKit.configuration.backgroundColor + } + override public func viewDidLoad() { super.viewDidLoad() - view.backgroundColor = ShopifyCheckoutSheetKit.configuration.backgroundColor - view.addSubview(checkoutView) NSLayoutConstraint.activate([ checkoutView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), diff --git a/Sources/ShopifyCheckoutSheetKit/IndeterminateProgressBarView.swift b/Sources/ShopifyCheckoutSheetKit/IndeterminateProgressBarView.swift index d28ab196..bdbb20a3 100644 --- a/Sources/ShopifyCheckoutSheetKit/IndeterminateProgressBarView.swift +++ b/Sources/ShopifyCheckoutSheetKit/IndeterminateProgressBarView.swift @@ -17,10 +17,10 @@ class IndeterminateProgressBarView: UIView { NSLayoutConstraint.activate([ progressBar.topAnchor.constraint(equalTo: topAnchor), - progressBar.heightAnchor.constraint(equalToConstant: 4), + progressBar.heightAnchor.constraint(equalToConstant: 1), ]) - progressBar.tintColor = .systemGray5 + progressBar.tintColor = ShopifyCheckoutSheetKit.configuration.spinnerColor } override func didMoveToSuperview() { @@ -43,7 +43,6 @@ class IndeterminateProgressBarView: UIView { } func startAnimating() { - print("start animating") alpha = 1 isHidden = false }