Skip to content

Instantly share code, notes, and snippets.

@pictos
Last active January 22, 2019 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pictos/0cde1f52b467e772ad016e001b816954 to your computer and use it in GitHub Desktop.
Save pictos/0cde1f52b467e772ad016e001b816954 to your computer and use it in GitHub Desktop.
// Objective-C
#import "RCTBridgeModule.h"
@interface MyCustomModule : NSObject <RCTBridgeModule>
@end
@implementation MyCustomModule
RCT_EXPORT_MODULE();
// Available as NativeModules.MyCustomModule.processString
RCT_EXPORT_METHOD(processString:(NSString *)input callback:(RCTResponseSenderBlock)callback)
{
callback(@[[input stringByReplacingOccurrencesOfString:@"Goodbye" withString:@"Hello"]]);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment