-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Breaking] Adds @MainActor @preconcurrency to public delegate protocols #4724
Open
yuki-stripe
wants to merge
1
commit into
master
Choose a base branch
from
yuki/v25-main-actor-everywhere
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Stripe- @objc(applePayContext:didCreatePaymentMethod:paymentInformation:completion:) func applePayContext(_ context: StripeApplePay.STPApplePayContext, didCreatePaymentMethod paymentMethod: StripePayments.STPPaymentMethod, paymentInformation: PassKit.PKPayment, completion: @escaping StripeApplePay.STPIntentClientSecretCompletionBlock)
- @objc(applePayContext:didCompleteWithStatus:error:) func applePayContext(_ context: StripeApplePay.STPApplePayContext, didCompleteWith status: StripePayments.STPPaymentStatus, error: (any Swift.Error)?)
+ @objc(applePayContext:didCreatePaymentMethod:paymentInformation:completion:) @_Concurrency.MainActor @preconcurrency func applePayContext(_ context: StripeApplePay.STPApplePayContext, didCreatePaymentMethod paymentMethod: StripePayments.STPPaymentMethod, paymentInformation: PassKit.PKPayment, completion: @escaping StripeApplePay.STPIntentClientSecretCompletionBlock)
+ @objc(applePayContext:didCompleteWithStatus:error:) @_Concurrency.MainActor @preconcurrency func applePayContext(_ context: StripeApplePay.STPApplePayContext, didCompleteWith status: StripePayments.STPPaymentStatus, error: (any Swift.Error)?) StripePayments- @objc func authenticationPresentingViewController() -> UIKit.UIViewController
- @objc(prepareAuthenticationContextForPresentation:) optional func prepare(forPresentation completion: @escaping StripePayments.STPVoidBlock)
- @objc optional func configureSafariViewController(_ viewController: SafariServices.SFSafariViewController)
- @objc(authenticationContextWillDismissViewController:) optional func authenticationContextWillDismiss(_ viewController: UIKit.UIViewController)
+ @objc @_Concurrency.MainActor @preconcurrency func authenticationPresentingViewController() -> UIKit.UIViewController
+ @_Concurrency.MainActor @preconcurrency @objc(prepareAuthenticationContextForPresentation:) optional func prepare(forPresentation completion: @escaping StripePayments.STPVoidBlock)
+ @_Concurrency.MainActor @preconcurrency @objc optional func configureSafariViewController(_ viewController: SafariServices.SFSafariViewController)
+ @_Concurrency.MainActor @preconcurrency @objc(authenticationContextWillDismissViewController:) optional func authenticationContextWillDismiss(_ viewController: UIKit.UIViewController) StripePaymentsUI- @objc func auBECSDebitForm(_ form: StripePaymentsUI.STPAUBECSDebitFormView, didChangeToStateComplete complete: Swift.Bool)
+ @objc @_Concurrency.MainActor(unsafe) func auBECSDebitForm(_ form: StripePaymentsUI.STPAUBECSDebitFormView, didChangeToStateComplete complete: Swift.Bool)
- public class Coordinator : ObjectiveC.NSObject, StripePaymentsUI.STPCardFormViewDelegate {
- public func cardFormView(_ form: StripePaymentsUI.STPCardFormView, didChangeToStateComplete complete: Swift.Bool)
- public class Coordinator : ObjectiveC.NSObject, StripePaymentsUI.STPCardFormViewDelegate {
- public func cardFormView(_ form: StripePaymentsUI.STPCardFormView, didChangeToStateComplete complete: Swift.Bool)
- @objc func cardFormView(_ form: StripePaymentsUI.STPCardFormView, didChangeToStateComplete complete: Swift.Bool)
+ @objc @_Concurrency.MainActor(unsafe) func cardFormView(_ form: StripePaymentsUI.STPCardFormView, didChangeToStateComplete complete: Swift.Bool)
- public class Coordinator : ObjectiveC.NSObject, StripePaymentsUI.STPPaymentCardTextFieldDelegate {
- public func paymentCardTextFieldDidChange(_ cardField: StripePaymentsUI.STPPaymentCardTextField)
- public class Coordinator : ObjectiveC.NSObject, StripePaymentsUI.STPPaymentCardTextFieldDelegate {
- public func paymentCardTextFieldDidChange(_ cardField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidChange(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidBeginEditing(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldWillEndEditing(forReturn textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidEndEditing(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidBeginEditingNumber(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidEndEditingNumber(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidBeginEditingCVC(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidEndEditingCVC(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidBeginEditingExpiration(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidEndEditingExpiration(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidBeginEditingPostalCode(_ textField: StripePaymentsUI.STPPaymentCardTextField)
- @objc optional func paymentCardTextFieldDidEndEditingPostalCode(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidChange(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidBeginEditing(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldWillEndEditing(forReturn textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidEndEditing(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidBeginEditingNumber(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidEndEditingNumber(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidBeginEditingCVC(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidEndEditingCVC(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidBeginEditingExpiration(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidEndEditingExpiration(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidBeginEditingPostalCode(_ textField: StripePaymentsUI.STPPaymentCardTextField)
+ @objc @_Concurrency.MainActor(unsafe) optional func paymentCardTextFieldDidEndEditingPostalCode(_ textField: StripePaymentsUI.STPPaymentCardTextField) StripePaymentSheet- public func viewWillDisappear(_ animated: Swift.Bool) StripeApplePay- @objc(applePayContext:didSelectShippingMethod:handler:) optional func applePayContext(_ context: StripeApplePay.STPApplePayContext, didSelect shippingMethod: PassKit.PKShippingMethod, handler: @escaping (_ update: PassKit.PKPaymentRequestShippingMethodUpdate) -> Swift.Void)
- @objc optional func applePayContext(_ context: StripeApplePay.STPApplePayContext, didSelectShippingContact contact: PassKit.PKContact, handler: @escaping (_ update: PassKit.PKPaymentRequestShippingContactUpdate) -> Swift.Void)
+ @_Concurrency.MainActor @preconcurrency @objc(applePayContext:didSelectShippingMethod:handler:) optional func applePayContext(_ context: StripeApplePay.STPApplePayContext, didSelect shippingMethod: PassKit.PKShippingMethod, handler: @escaping (_ update: PassKit.PKPaymentRequestShippingMethodUpdate) -> Swift.Void)
+ @_Concurrency.MainActor @preconcurrency @objc optional func applePayContext(_ context: StripeApplePay.STPApplePayContext, didSelectShippingContact contact: PassKit.PKContact, handler: @escaping (_ update: PassKit.PKPaymentRequestShippingContactUpdate) -> Swift.Void)
- @objc optional func applePayContext(_ context: StripeApplePay.STPApplePayContext, didChangeCouponCode couponCode: Swift.String, handler completion: @escaping (PassKit.PKPaymentRequestCouponCodeUpdate) -> Swift.Void)
- @objc optional func applePayContext(_ context: StripeApplePay.STPApplePayContext, willCompleteWithResult authorizationResult: PassKit.PKPaymentAuthorizationResult, handler: @escaping (_ authorizationResult: PassKit.PKPaymentAuthorizationResult) -> Swift.Void)
+ @_Concurrency.MainActor @preconcurrency @objc optional func applePayContext(_ context: StripeApplePay.STPApplePayContext, didChangeCouponCode couponCode: Swift.String, handler completion: @escaping (PassKit.PKPaymentRequestCouponCodeUpdate) -> Swift.Void)
+ @_Concurrency.MainActor @preconcurrency @objc optional func applePayContext(_ context: StripeApplePay.STPApplePayContext, willCompleteWithResult authorizationResult: PassKit.PKPaymentAuthorizationResult, handler: @escaping (_ authorizationResult: PassKit.PKPaymentAuthorizationResult) -> Swift.Void)
- func applePayContext(_ context: StripeApplePay.STPApplePayContext, didCreatePaymentMethod paymentMethod: StripeCore.StripeAPI.PaymentMethod, paymentInformation: PassKit.PKPayment, completion: @escaping StripeApplePay.STPIntentClientSecretCompletionBlock)
- func applePayContext(_ context: StripeApplePay.STPApplePayContext, didCompleteWith status: StripeApplePay.STPApplePayContext.PaymentStatus, error: (any Swift.Error)?)
+ @_Concurrency.MainActor @preconcurrency func applePayContext(_ context: StripeApplePay.STPApplePayContext, didCreatePaymentMethod paymentMethod: StripeCore.StripeAPI.PaymentMethod, paymentInformation: PassKit.PKPayment, completion: @escaping StripeApplePay.STPIntentClientSecretCompletionBlock)
+ @_Concurrency.MainActor @preconcurrency func applePayContext(_ context: StripeApplePay.STPApplePayContext, didCompleteWith status: StripeApplePay.STPApplePayContext.PaymentStatus, error: (any Swift.Error)?) If you are adding a new public API consider the following:
If you are modifying or removing a public API:
If you confirm these APIs need to be added/updated and have undergone necessary review, add the label ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with |
davidme-stripe
approved these changes
Mar 28, 2025
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.
See https://docs.google.com/document/d/1iSA42ZG4leIT1d96riQxhBpgiIZ3oVABaQ-Yj5uHTmc/edit?tab=t.0#heading=h.570u4leviueu
Testing
Existing tests should cover cases where concurrency checks is minimal.
I've done manual testing using an example project w/ strict concurrency on to verify the claims made in the API Review.
Changelog
See CHANGELOG