From 0f3d24c7fbb3a53c3dfa38e08853f335e0eaa5ef Mon Sep 17 00:00:00 2001 From: Joshua May Date: Tue, 11 Oct 2016 07:39:10 -0700 Subject: [PATCH] Updates Swift @objc export for recent Swift versions Summary: As of Swift 3, [Swift converts Objective-C API names based on parameters](https://github.com/apple/swift-evolution/blob/master/proposals/0005-objective-c-name-translation.md), so the docs should explicitly declare what the Objective-C API is (because it's also used in the JavaScript side too). An alternative to this would be to update the Objective-C and JavaScript calls to be `addEventWithName:location:date:` / `addEventWithName()` based on the default Swift API, but I think the approach in the PR is most correct here. Closes https://github.com/facebook/react-native/pull/10176 Differential Revision: D4001604 Pulled By: hramos fbshipit-source-id: cd4143d19d2d375288a086b9d7995e75fe1e9170 --- docs/NativeModulesIOS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/NativeModulesIOS.md b/docs/NativeModulesIOS.md index 824ef74c1..e36b3a13f 100644 --- a/docs/NativeModulesIOS.md +++ b/docs/NativeModulesIOS.md @@ -383,7 +383,8 @@ Let's say we have the same `CalendarManager` but as a Swift class: @objc(CalendarManager) class CalendarManager: NSObject { - @objc func addEvent(name: String, location: String, date: NSNumber) -> Void { + @objc(addEvent:location:date:) + func addEvent(name: String, location: String, date: NSNumber) -> Void { // Date is ready to use! }