Closed WalterZou closed 1 year ago
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.
@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.
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.
Add conditional imports for macOS compilation to fix import errors when used in multiple platform SwiftUI apps. #130