-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: Removed UIKit dependencies from many files #464
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really clean. Thank you for taking the time to do it—it'll be nice to get a more native macOS version working. I think my only request is a rename on Image
to something that doesn't conflict with SwiftUI. (Apple's new API naming is as self-important and short sighted as their app naming.)
OpoLua/Model/Image.swift
Outdated
#else | ||
|
||
import AppKit | ||
typealias Image = NSImage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not call this Image
as that conflicts with SwiftUI and is pretty misleading. I suspect there's actually more we can do with SwiftUI's image in this scenario but for the time being how about we simply call it CommonImage
or somesuch?
OpoLua/Model/Image.swift
Outdated
|
||
extension Image { | ||
|
||
static func clockMedium() -> Image { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xcode will now synthesize symbols for images in the project so we might be able to get away without these now. Still, not a high priority.
@@ -208,6 +222,7 @@ class CanvasView : UIView, Drawable { | |||
return canvas.size.cgSize() | |||
} | |||
|
|||
#if canImport(UIKit) // TODO AppKit version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
Thank you for the change. Approved! 🎉 |
c665580
to
c380ea9
Compare
And made CanvasView and RootView derive from either UIView or NSView, and images be either UIImage or NSImage