-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[modules-core] Add macOS support #26186
Conversation
68de3da
to
08825de
Compare
@@ -44,12 +43,32 @@ - (id)forwardingTargetForSelector:(SEL)selector | |||
|
|||
#if __has_include(<React-RCTAppDelegate/RCTAppDelegate.h>) || __has_include(<React_RCTAppDelegate/RCTAppDelegate.h>) | |||
|
|||
- (UIView *)findRootView:(UIApplication *)application |
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.
didn't see any code to use the new method?
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.
Oops, looks like it remained here after resolving conflicts. You removed that method a while ago 😅
Edit: I removed it from here!
@@ -69,7 +88,7 @@ - (UIView *)createRootViewWithBridge:(RCTBridge *)bridge | |||
moduleName:moduleName | |||
initialProperties:initProps | |||
fabricEnabled:enableFabric]; | |||
#if !TARGET_OS_TV | |||
#if !TARGET_OS_TV && !TARGET_OS_OSX | |||
rootView.backgroundColor = UIColor.systemBackgroundColor; |
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.
not sure whether we should use NSColor.windowBackgroundColor
for macos?
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.
NSView
doesn't have the backgroundColor
property, but looks like we can change that on its layer. I'll change it.
Co-authored-by: Kudo Chien <kudo@expo.dev>
Why
Adds support for macOS platform to the
expo-modules-core
package. It's been separated from #22796.How
react-native-macos
does, but we need to expose that to Swift.Platform.h
if needed).Test Plan
Tested in https://github.com/tsapeta/expo-macos-example as part of the bigger PR #22796