diff --git a/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/ApplePayAuthorizationDelegate/ApplePayAuthorizationDelegate.swift b/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/ApplePayAuthorizationDelegate/ApplePayAuthorizationDelegate.swift index 92c1458f..b967ebd2 100644 --- a/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/ApplePayAuthorizationDelegate/ApplePayAuthorizationDelegate.swift +++ b/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/ApplePayAuthorizationDelegate/ApplePayAuthorizationDelegate.swift @@ -6,16 +6,17 @@ import ShopifyCheckoutKit /// Protocol to abstract PKPaymentAuthorizationController for testing @available(iOS 16.0, *) +@MainActor protocol PaymentAuthorizationController { - var delegate: PKPaymentAuthorizationControllerDelegate? { get set } + var delegate: (any PKPaymentAuthorizationControllerDelegate)? { get set } func present() async -> Bool - func dismiss(completion: (() -> Void)?) + func dismiss(completion: (@Sendable () -> Void)?) } extension PKPaymentAuthorizationController: PaymentAuthorizationController {} @available(iOS 16.0, *) -typealias PKAuthorizationControllerFactory = (PKPaymentRequest) -> PaymentAuthorizationController +typealias PKAuthorizationControllerFactory = @MainActor @Sendable (PKPaymentRequest) -> any PaymentAuthorizationController @available(iOS 16.0, *) @MainActor diff --git a/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/Data/PassKitFactory.swift b/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/Data/PassKitFactory.swift index bd43b9bc..137de8f6 100644 --- a/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/Data/PassKitFactory.swift +++ b/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/Data/PassKitFactory.swift @@ -1,7 +1,7 @@ import PassKit @available(iOS 16.0, *) -class PassKitFactory { +final class PassKitFactory: Sendable { static let shared = PassKitFactory() private struct DeliveryOptionWithGroupType {