Updated swift section to match current code base
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Current documentation was outdated. Follow the swift section with a recent version of RN and see that it works? Closes https://github.com/facebook/react-native/pull/16260 Differential Revision: D6017759 Pulled By: hramos fbshipit-source-id: 5d3ea56b08427694016c39b7ace5b2d5c63c1f4c
This commit is contained in:
parent
0cd69e8a02
commit
3eced7faba
|
@ -439,7 +439,7 @@ class CalendarManager: NSObject {
|
|||
// Date is ready to use!
|
||||
}
|
||||
|
||||
override func constantsToExport() -> [String: Any]! {
|
||||
func constantsToExport() -> [String: Any]! {
|
||||
return ["someKey": "someValue"]
|
||||
}
|
||||
|
||||
|
@ -468,4 +468,6 @@ For those of you new to Swift and Objective-C, whenever you [mix the two languag
|
|||
#import <React/RCTBridgeModule.h>
|
||||
```
|
||||
|
||||
You can also use `RCT_EXTERN_REMAP_MODULE` and `RCT_EXTERN_REMAP_METHOD` to alter the JavaScript name of the module or methods you are exporting. For more information see [`RCTBridgeModule`](https://github.com/facebook/react-native/blob/master/React/Base/RCTBridgeModule.h).
|
||||
You can also use `RCT_EXTERN_REMAP_MODULE` and `_RCT_EXTERN_REMAP_METHOD` to alter the JavaScript name of the module or methods you are exporting. For more information see [`RCTBridgeModule`](https://github.com/facebook/react-native/blob/master/React/Base/RCTBridgeModule.h).
|
||||
|
||||
> **Important when making third party modules**: Static libraries with Swift are only supported in Xcode 9 and later. In order for the Xcode project to build when you use Swift in the iOS static library you include in the module, your main app project must contain Swift code and a bridging header itself. If your app project does not contain any Swift code, a workaround can be a single empty .swift file and an empty bridging header.
|
||||
|
|
Loading…
Reference in New Issue