Skip to content

Fix crash in lazy protocol witness table accessor for type PayWithApplePayButtonLabel on iOS 18#569

Open
fynnrhm wants to merge 1 commit into
Shopify:mainfrom
fynnrhm:fix/apple-pay-passkit-button-types
Open

Fix crash in lazy protocol witness table accessor for type PayWithApplePayButtonLabel on iOS 18#569
fynnrhm wants to merge 1 commit into
Shopify:mainfrom
fynnrhm:fix/apple-pay-passkit-button-types

Conversation

@fynnrhm
Copy link
Copy Markdown

@fynnrhm fynnrhm commented May 21, 2026

What changes are you making?

Summary

  • keep the UIKit-backed Apple Pay button implementation in place
  • expose native PassKit button type/style values through .applePayLabel(_:) and .applePayStyle(_:)
  • remove the SwiftUI PayWithApplePayButton* to PKPaymentButton* mapping layer and update samples/docs

Crash context

This is intended to avoid the iOS 18 cart initialization crash seen while resolving the mapped SwiftUI Apple Pay label/style values:

Exception 1, Code 1, Subcode 12 > KERN_INVALID_ADDRESS at 0xc
libswiftCore swift::_getWitnessTable
PayWithApplePayButtonLabel.pkPaymentButtonType.getter (ApplePayButton.swift:171)
Internal_ApplePayButton.body.getter (ApplePayButton.swift:140)
SwiftUICore ViewBodyAccessor.updateBody
Screenshot 2026-05-21 at 22 21 09

By accepting PKPaymentButtonType and PKPaymentButtonStyle directly, the representable receives native PassKit values without the extra computed-property mapping on the SwiftUI types.

Verification

  • scripts/xcode_run test ShopifyCheckoutSheetKit-Package ShopifyAcceleratedCheckoutsTests/ApplePayIntegrationTests
  • Scripts/build_samples
  • git diff --check

Before you merge

Important

Releasing a new version of the kit?

Releasing a new major version?

  • I have bumped the version number in the README.

Tip

See the Contributing documentation for instructions on how to publish a new version of the library.

@fynnrhm fynnrhm requested a review from a team as a code owner May 21, 2026 22:18
@fynnrhm fynnrhm marked this pull request as draft May 21, 2026 22:22
@fynnrhm fynnrhm marked this pull request as ready for review May 21, 2026 22:22
@fynnrhm fynnrhm closed this May 21, 2026
@fynnrhm fynnrhm reopened this May 21, 2026
@fynnrhm fynnrhm closed this May 21, 2026
@fynnrhm fynnrhm reopened this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant