Skip to content

[Swift][Sample]: Add a checkout presentation picker - #775

Draft
kieran-osgood-shopify wants to merge 1 commit into
mainfrom
ko/swift-sample-checkout-presentation
Draft

kieran-osgood-shopify wants to merge 1 commit into
mainfrom
ko/swift-sample-checkout-presentation

Conversation

@kieran-osgood-shopify

Copy link
Copy Markdown
Contributor

What changes are you making?

Add a persisted Checkout presentation picker under Settings → Features in the Swift demo.

SwiftUI (default) UIKit
Existing ShopifyCheckout sheet Direct CheckoutViewController construction and UIKit presentation

The picker changes the Cart tab's checkout API, not its cart UI. The separate UIKit cart, accelerated checkouts and universal-link routes remain unchanged. Both modes share completion/dismissal handling so the cart is reset only after a completed checkout is dismissed.

This is the sample-only base of #649. No URL-decoration workaround is added here: UIKit with preloading disabled still exposes the existing missing-ECP-parameters behavior, which #649 fixes above this PR.

Adds 11 tests covering defaults, persistence, routing, appearance, protocol handlers and checkout lifecycle handling.

How to test

SwiftUI default

GIVEN a fresh installation of the Swift demo configured for a test storefront

AND Settings → Features → Checkout preloading is disabled

WHEN you inspect Settings → Features → Checkout presentation

THEN SwiftUI is selected by default.

WHEN you add an item and tap Check out in the Cart tab

THEN the existing SwiftUI checkout sheet opens.

WHEN you close checkout without placing an order

THEN the item remains in the cart.


UIKit selection and persistence

GIVEN the Swift demo is running from Xcode and configured for a test storefront

AND Settings → Features → Checkout preloading is disabled

AND you have a breakpoint on the direct CheckoutViewController(...) call in CartCheckoutPresentation.present

WHEN you select UIKit under Settings → Features → Checkout presentation, then stop and rerun the app from Xcode

THEN the picker still shows UIKit.

WHEN you add an item and tap Check out in the Cart tab

THEN the direct-controller breakpoint is hit.

WHEN you resume execution and close checkout without placing an order

THEN the item remains in the cart.

Verification

Local sample tests pass independently on this layer. Full-stack Swift/sample tests, both sample builds, SwiftLint, SwiftFormat, CocoaPods lint and public API checks also pass. Runtime dogfooding is pending.


Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

SDK README changes are not required for this sample-only setting.

Assisted-By: devx/e9549c39-4038-46fb-b955-39538bc9441f
@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 14, 2026
@kieran-osgood-shopify
kieran-osgood-shopify added this pull request to stack #776 September 14, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant