-
Notifications
You must be signed in to change notification settings - Fork 52
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 --swift language option #353
base: master
Are you sure you want to change the base?
Conversation
Hi when are you planning to merge this changes? |
I will try to finish and merge this in the near future. |
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.
A static requiresMainQueueSetup method or some other solution is needed to help avoid an ugly message like this:
Module AwesomeNativeModule requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
ref:
- https://stackoverflow.com/questions/50929930/understanding-when-to-use-dispatch-get-main-queue-and-requiresmainqueuesetup-by/51014267#51014267
- How can we use swift instead of objective Objective-C ? #221 (comment)
I think the next step would be to understand why we need to specify this queue setup for Swift but not for Objective-C.
I would also like to see some documentation here: https://reactnative.dev/docs/native-modules-ios#exporting-swift
ive been using this via adding
to the Swift file resolved the requiresMainQueueSetup issue |
--swift
CLI optionswift
option to library API (not documented at this point)--swift
option is enabledresolves #221
only tested with React Native 0.62 at this point
I would like to give thanks to the following resources for some extremely helpful guidance for a Swift beginner like myself:
and some other interesting resources I found:
TODO items:
swift
option enabled/cc @dlowder-salesforce