Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Not compiling on ios due to use of NSColor #36

Open
SoylentGraham opened this issue Nov 18, 2024 · 1 comment
Open

Not compiling on ios due to use of NSColor #36

SoylentGraham opened this issue Nov 18, 2024 · 1 comment

Comments

@SoylentGraham
Copy link

Seems like all the backgroundColor:NSColor variables can be replaced with SwiftUI.Color and then at the end a cross platform alias

#if os(macOS)
  import AppKit

  typealias UXTextView          = NSTextView
  typealias UXTextViewDelegate  = NSTextViewDelegate
  typealias UColor              = NSColor
#else
  import UIKit

  typealias UXTextView          = UITextView
  typealias UXTextViewDelegate  = UITextViewDelegate
  typealias UColor              = UIColor
#endif
SoylentGraham added a commit to NewChromantics/CodeEditor that referenced this issue Nov 18, 2024
@SoylentGraham
Copy link
Author

Note to self, use #if canImport(UIKit) not os()

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant