I am integrating React Native to an existing iOS/Android Project. I am trying to make a native module to help with navigating to iOS screens from React Native screens. I was able to create my Android Native Module for navigation to call Android Activities from React Native.
When writing my Navigation Native Module for iOS, Xcode keeps highlighting my method with a "Semicolon before method body is ignored" error for all my RCT_EXPORT_METHOD() methods.
I am using Xcode 9.2, React Native 0.59.3.
https://facebook.github.io/react-native/docs/native-modules-ios#docsNav
I have been following the documentation from above and I cannot figure out why Xcode is not recognizing the syntax. I've also tried running code in Xcode 9.4 and get the same "Semicolon before method body is ignored" syntax error.
NavigationModule.h
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
@interface NavigationModule : NSObject <RCTBridgeModule>
@end
NavigationModule.m
#import "NavigationModule.h"
@implementation NavigationModule
RCT_EXPORT_MODULE(NavigationModule);
RCT_EXPORT_METHOD(onOptionAboutSelected:(NSString *)title)
{
//TODO
}
RCT_EXPORT_METHOD(onOptionLockSelected)
{
//TODO
}
@end
Any help would be appreciated.