[Swift][Sample]: Add a checkout presentation picker - #775
Draft
kieran-osgood-shopify wants to merge 1 commit into
Draft
kieran-osgood-shopify wants to merge 1 commit into
kieran-osgood-shopify wants to merge 1 commit into
Conversation
Assisted-By: devx/e9549c39-4038-46fb-b955-39538bc9441f
kieran-osgood-shopify
added this pull request to stack #776
September 14, 2026 14:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are you making?
Add a persisted Checkout presentation picker under Settings → Features in the Swift demo.
ShopifyCheckoutsheetCheckoutViewControllerconstruction and UIKit presentationThe 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 inCartCheckoutPresentation.presentWHEN 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
platforms/swift/README.mdand/orplatforms/android/README.md)SDK README changes are not required for this sample-only setting.