-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Xcode tries to use AppKit when compiling with Mac Catalyst #4233
Comments
I'm not sure whose bug it is -
I guess you have to file a radar for Apple and see what's their response. Because this library does support macOS, but combining the case the catalyst, I'm not sure how the catalyst works especially for our case. If you got the source code, you can simply delete these macros and see if you can run it and let us know the result. @jjatie any idea? |
I think the issue is that Catalyst is in this weird limbo state where some things about Mac development apply to it and some don't, so some of the recent tech decisions made by the Charts project present issues since Charts is aiming to be compatible with Mac development proper. For a project I did for the iPad, I had taken a build/version based off of the Between those two commits it looks like the "Platform+" concept took hold, with source files like "Platform+Color.swift" and "Platform+Graphics.swift", etc. This is where the Just as a quick proof of concept hack, I changed these lines to be
And everything works fine. The lines in the AppKit causing issues are trying to alias things like NSColor when NSColor doesn't exist in Catalyst since, essentially, Catalyst is trying to be "UIKIt for Mac" and so it needs to use UIKit equivalents like UIColor. Some of this is just due to Catalyst being a half-baked concept but as a band-aid of sorts this should work. |
Created a PR to address this. |
What did you do?
Checked the Mac target in project settings.
What did you expect to happen?
For the project to compile without error.
What happened instead?
There were errors due to
#if canImport(AppKit)
being used — the target is a Mac so it can be imported, but Mac Catalyst won't build if it is.Charts Environment
Charts version/Branch/Commit Number: master
Xcode version: 11.3 beta (11C24b)
Swift version: 5
Platform(s) running Charts: iOS, Mac Catalyst
macOS version running Xcode: 10.15.2 Beta (19C46a)
Demo Project
[Literally just use any Charts project and check the Mac target such that it uses Mac Catalyst].
The text was updated successfully, but these errors were encountered: