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

Add #if os(macOS) macro #72

Closed
wants to merge 4 commits into from
Closed

Add #if os(macOS) macro #72

wants to merge 4 commits into from

Conversation

akring
Copy link

@akring akring commented Mar 29, 2024

Thank you very much for developing such a useful library.

I'm working on a SwiftUI-based project that also supports iOS/macOS, and when I'm using Keyholder, everything is perfect, the only problem is that it breaks the preview of the iOS platform and keeps it in an uncompilable state.

After some experimentation, I found that I needed to add the #if os (macOS) macro to the Keyholder and associated Sauce/Magnet to explicitly tell the preview not to import and compile this part of the code on iOS platforms.

SwiftUI and cross-platform apps are becoming more and more common, and preview is a very powerful feature in SwiftUI. So I think this change is necessary.

Thanks!

@Econa77 Econa77 assigned Econa77 and unassigned Econa77 Mar 31, 2024
@Econa77 Econa77 self-requested a review March 31, 2024 16:38
@akring
Copy link
Author

akring commented Apr 8, 2024

Hi, I would like to ask if there is anything that needs to be modified in this PR?

@akring akring closed this Apr 17, 2024
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.

2 participants