-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[Swift] Incomplete documentation for exporting custom Swift module? #1468
Comments
@kevindeleon whenever you mix objective c and swift you need a bridging file. This is standard practice however you're right that they should add a line in the doc |
@kevindeleon did you manage to implement a native UI widget using Swift? as per https://facebook.github.io/react-native/docs/nativecomponentsios.html#content |
@olivierlesnicki No, it was a native module using Swift. I basically ported over a module Jay Garcia had created as a proof of concept in Objective C...I just wanted to see how difficult it would be in Swift. You can read more about the process or view the code on github. And if it's a common practice that most Swift developers would just know, then maybe it doesn't need a line in the documentation. I'd like a few more opinions before I close it. As a web guy coming over to the Swift/ObjC world...it was a bit confusing, and I assume most folks using RN will have the same background as I do (web guys coming over to the "native" world). |
@olivierlesnicki I went ahead and created a pull request with some proposed documentation changes. I'll let the team decide if it's worthwhile. |
Closed with #1548 😄 |
I was working on creating a custom module using swift based on a tutorial by Jay Garcia. I've got everything working, but one thing I did run into that doesn't seem to be in the documentation is the need for an objective-c bridging file (see in my github repo the following file) that contains an import for
RCTBridgeModule.h
. Without that bridging header file, I receive an error on build that Xcode can't find the bridging header file, and without the import statement in that file, I receive a build error saying that I'm trying to use an undeclared type (RCTResponseSenderBlock
).I'm not a Swift guru, so I'm not sure if that is something I should have just known and has been left out for that reason, an error on my part or if it's a piece of the documentation that is missing. If it's missing documentation, I can try to write something up for it, but not being a Swift expert, I'd definitely need someone to review it.
The text was updated successfully, but these errors were encountered: