Conversation
|
Hi when are you planning to merge this changes? |
Owner
Author
|
I will try to finish and merge this in the near future. |
added 5 commits
July 8, 2021 17:28
…tive-module into add-swift-option
…eact-native-module into add-swift-option
brody4hire
commented
Jul 8, 2021
Owner
Author
brody4hire
left a comment
There was a problem hiding this comment.
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
- https://github.com/brodybits/create-react-native-module/issues/221#issuecomment-585672378
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--swiftCLI optionswiftoption to library API (not documented at this point)--swiftoption 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:
swiftoption enabled/cc @dlowder-salesforce