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

Added conditional imports for macOS in multiple files #138

Closed
wants to merge 1 commit into from

Conversation

WalterZou
Copy link

Add conditional imports for macOS compilation to fix import errors when used in multiple platform SwiftUI apps. #130

…rt error when used in multiple platform SwiftUI App
@sindresorhus
Copy link
Owner

It doesn't make sense to wrap every file in this. You can specify yourself in Xcode that a dependency is only meant for a certain platform.

@WalterZou
Copy link
Author

WalterZou commented Jul 27, 2023

@sindresorhus
Thank you for your reply. KeyboardShortcuts is an amazing project. However, in scenarios like #130, when developing Multiple-Platform Apps with a unified target using Swift UI, even if KeyboardShortcuts are specified for macOS in Xcode, there might still be a compilation error only on macOS. This PR can address and resolve this issue.

@WalterZou
Copy link
Author

After upgrading to Xcode 15 beta5, I noticed that there is no longer a need to add macOS compilation conditionals, and the compilation errors are gone (but Xcode 14 still has this issue). Therefore, I have closed this pull request. Thank you very much.

@WalterZou WalterZou closed this Jul 27, 2023
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.

None yet

2 participants