Added non-class-scanning-based approach fror registering js methods

This commit is contained in:
Nick Lockwood
2015-04-08 05:42:43 -07:00
parent 21a054e9fc
commit bf4868edda
55 changed files with 283 additions and 237 deletions

View File

@@ -15,10 +15,13 @@
@end
@implementation RCTActionSheetManager {
@implementation RCTActionSheetManager
{
NSMutableDictionary *_callbacks;
}
RCT_EXPORT_MODULE()
- (instancetype)init
{
if ((self = [super init])) {

View File

@@ -11,6 +11,8 @@
@implementation RCTAdSupport
RCT_EXPORT_MODULE()
- (void)getAdvertisingId:(RCTResponseSenderBlock)callback withErrorCallback:(RCTResponseSenderBlock)errorCallback
{
RCT_EXPORT();

View File

@@ -25,6 +25,8 @@
RCTSparseArray *_animationRegistry; // Main thread only; animation tag -> view tag
}
RCT_EXPORT_MODULE()
@synthesize bridge = _bridge;
- (instancetype)init

View File

@@ -99,6 +99,8 @@ static NSDictionary *RCTPositionError(RCTPositionErrorCode code, NSString *msg /
RCTLocationOptions _observerOptions;
}
RCT_EXPORT_MODULE()
@synthesize bridge = _bridge;
#pragma mark - Lifecycle

View File

@@ -19,6 +19,8 @@
@implementation RCTCameraRollManager
RCT_EXPORT_MODULE()
- (void)saveImageWithTag:(NSString *)imageTag successCallback:(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseSenderBlock)errorCallback
{
RCT_EXPORT();

View File

@@ -18,6 +18,8 @@
@implementation RCTNetworkImageViewManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
RCTNetworkImageView *view = [[RCTNetworkImageView alloc] initWithFrame:CGRectZero imageDownloader:[RCTImageDownloader sharedInstance]];

View File

@@ -18,6 +18,8 @@
@implementation RCTStaticImageManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
return [[RCTStaticImage alloc] init];

View File

@@ -16,6 +16,8 @@ NSString *const RCTOpenURLNotification = @"RCTOpenURLNotification";
@implementation RCTLinkingManager
RCT_EXPORT_MODULE()
@synthesize bridge = _bridge;
- (instancetype)init

View File

@@ -15,6 +15,8 @@
@implementation RCTDataManager
RCT_EXPORT_MODULE()
/**
* Executes a network request.
* The responseSender block won't be called on same thread as called.

View File

@@ -23,6 +23,8 @@ static NSString *const RCTReachabilityStateCell = @"cell";
NSString *_status;
}
RCT_EXPORT_MODULE()
@synthesize bridge = _bridge;
static void RCTReachabilityCallback(__unused SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *info)

View File

@@ -19,6 +19,8 @@ NSString *const RCTRemoteNotificationReceived = @"RemoteNotificationReceived";
NSDictionary *_initialNotification;
}
RCT_EXPORT_MODULE()
@synthesize bridge = _bridge;
- (instancetype)init

View File

@@ -13,12 +13,15 @@
#import "RCTAssert.h"
#import "RCTLog.h"
@implementation RCTTestModule {
@implementation RCTTestModule
{
__weak FBSnapshotTestController *_snapshotController;
__weak UIView *_view;
NSMutableDictionary *_snapshotCounter;
}
RCT_EXPORT_MODULE()
- (instancetype)initWithSnapshotController:(FBSnapshotTestController *)controller view:(UIView *)view
{
if ((self = [super init])) {

View File

@@ -19,9 +19,12 @@
#import <Availability.h>
#if TARGET_OS_IPHONE
#define HAS_ICU
#endif
//NOTE: libicucore ins't actually needed for the socket to function
//and by commenting this out, we avoid the need to import it into every app.
//#if TARGET_OS_IPHONE
//#define HAS_ICU
//#endif
#ifdef HAS_ICU
#import <unicode/utf8.h>

View File

@@ -13,6 +13,8 @@
@implementation RCTRawTextManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
return nil;

View File

@@ -20,6 +20,8 @@
@implementation RCTTextManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
return [[RCTText alloc] init];

View File

@@ -13,6 +13,8 @@
@implementation RCTVibration
RCT_EXPORT_MODULE()
- (void)vibrate
{
RCT_EXPORT();