checkout-sheet-kit-swift icon indicating copy to clipboard operation
checkout-sheet-kit-swift copied to clipboard

UI discrepancy between UIKit and SwiftUI

Open joshgare opened this issue 1 year ago • 3 comments
trafficstars

What area is the issue related to?

Checkout Sheet Kit

What version of Checkout Sheet Kit are you using?

2.0.1

Do you have a minimum reproducible example?

No response

Steps to Reproduce

  • Display sheet via Swift UI
  • Display sheet via UIKit
  • Compare navigation bars

Expected Behavior

Navigation bar on UIKit sheet to filled in on presentation, not just when the checkout scrolls down.

Actual Behavior

UIKit sheet displays a clear navigation bar on presentation which looks off. When you scroll down the on the UIKit sheet the navigation bar fills in. This feels a buggy and looks off which is not desired in a checkout flow.

Screenshots/Videos/Log output

  1. Swift UI on present (looks good)

Simulator Screenshot - iPhone 15 Pro - 2024-05-08 at 10 25 19

  1. UIKit on present (looks off)

Simulator Screenshot - iPhone 15 Pro Max - 2024-05-08 at 14 01 02

Storefront domain

No response

joshgare avatar May 08 '24 13:05 joshgare

Hey @joshgare, can you share some of the code you're using to trigger the sheet with UIKit?

Have you checked our sample applications for reference?

markmur avatar May 08 '24 13:05 markmur

Hi @markmur

Structure is as follows UIViewController that is modally presented -> button tapped -> present method called and checkout sheet is presented over the top of the previous modal.

ShopifyCheckoutSheetKit.present(checkout: url, from: self, delegate: self)

joshgare avatar May 09 '24 10:05 joshgare

Thanks @joshgare. I'm updating our sample app in this PR to include an example of this flow. Would you say that the code here is similar to what you're doing?

The background color of the checkout sheet should be set to .systemBackground by default. Are you overriding the configuration at all?

You can explicitly set this in your application:

ShopifyCheckoutSheetKit.configure {
    $0.backgroundColor = .white
}

https://github.com/Shopify/checkout-sheet-kit-swift/assets/2034704/420824f2-225b-4b40-9915-e5b29e6a2307

markmur avatar May 10 '24 09:05 markmur

@markmur just coming back to this - we updated the SDK to 3.0.1 and added the following.

ShopifyCheckoutSheetKit.configure {
    $0.backgroundColor = .white
}

However we're still seeing the UI issue when presenting the modal via UIKit.

https://github.com/Shopify/checkout-sheet-kit-swift/assets/113687/cf81dc8b-3d7d-48b0-a8db-8ae8ed669895

joshgare avatar Jun 30 '24 09:06 joshgare

Hey @joshgare,

Can you share some code to show how you're implementing this?

Are you setting any colors globally that might be causing this?

markmur avatar Jul 02 '24 10:07 markmur

@markmur the code we're using is very simple we set the global properties then present the CSK and retain a reference.

guard let url = webUrl.asUrl else { return }
ShopifyCheckoutSheetKit.configure {
    $0.backgroundColor = .white
    $0.colorScheme = .web
    $0.tintColor = .black
}
checkoutViewController = ShopifyCheckoutSheetKit.present(checkout: url, from: self, delegate: self)

joshgare avatar Jul 02 '24 11:07 joshgare

Does explicitly setting a value for backgroundColor on your controller fix the issue?

I'm trying to trying to reproduce in our sample app again, but haven't been able to yet.

markmur avatar Jul 02 '24 11:07 markmur

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in 30 days. Thank you for your contributions.

github-actions[bot] avatar Aug 02 '24 03:08 github-actions[bot]

This issue has been automatically closed because it has not had recent activity. Please re-open it if it is still relevant.

github-actions[bot] avatar Aug 09 '24 03:08 github-actions[bot]