Skip to content
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

Fix Warnings #1958

Closed
wants to merge 5 commits into from
Closed

Fix Warnings #1958

wants to merge 5 commits into from

Conversation

goergisn
Copy link
Contributor

@goergisn goergisn commented Jan 20, 2025

Summary

  • Checking if the compiler knows about the backported apple pay enum case
  • Updating Project settings
  • Adding @retroactive for extensions of foundational types

Background regarding #if compiler(>=6)

Xcode started complaining:

Extension declares a conformance of imported type 'Array' to imported protocol 'AdyenCompatible'; 
this will not behave correctly if the owners of 'Swift' introduce this conformance in the future

Issue

When adding the @retroactive tag it silences the warning but it will start failing if you build with a compiler that doesn’t know about this label. Which is the case on our CI because we need older Xcodes (with older toolchain) to get access to older Simulators to be able to test older iOS versions.

Solution

You can check for the swift or compiler version that is used to compile your project via a compiler directive.

e.g.

#if swift(>=6) // Checks for the minimum swift version
#if compiler(>=6) // Checks for the minimum compiler version

So wrapping the code in an #if compiler(>=6) block and providing the old code in the #else block silences the warnings AND allows you to build the code with older toolchains

Ticket

COIOS-000

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: ['new', 'changed', 'fixed', 'removed', 'deprecated', 'chore', 'improvement']

@goergisn goergisn added the chore a pull request that has chore changes that shouldn't be in the release notes label Jan 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Jan 20, 2025
atmamont
atmamont previously approved these changes Jan 20, 2025
@goergisn goergisn dismissed stale reviews from atmamont and github-actions[bot] via 602839d January 20, 2025 14:06
@goergisn goergisn changed the title Fix Apple Pay warning Fix Warnings Jan 20, 2025
github-actions[bot]
github-actions bot previously approved these changes Jan 20, 2025
Copy link
Contributor

✅ No changes detected

Comparing fix-apple-pay-warning to develop


Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCashAppPay, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenWeChatPay

@goergisn goergisn requested a review from atmamont January 20, 2025 15:00
@goergisn
Copy link
Contributor Author

Closing due to quite some changes for very little benefit

@goergisn goergisn closed this Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore a pull request that has chore changes that shouldn't be in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants