mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-11 22:32:38 +08:00
Added non-class-scanning-based approach fror registering js methods
This commit is contained in:
@@ -15,10 +15,13 @@
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTActionSheetManager {
|
||||
@implementation RCTActionSheetManager
|
||||
{
|
||||
NSMutableDictionary *_callbacks;
|
||||
}
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
@implementation RCTAdSupport
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (void)getAdvertisingId:(RCTResponseSenderBlock)callback withErrorCallback:(RCTResponseSenderBlock)errorCallback
|
||||
{
|
||||
RCT_EXPORT();
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
RCTSparseArray *_animationRegistry; // Main thread only; animation tag -> view tag
|
||||
}
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
@synthesize bridge = _bridge;
|
||||
|
||||
- (instancetype)init
|
||||
|
||||
@@ -99,6 +99,8 @@ static NSDictionary *RCTPositionError(RCTPositionErrorCode code, NSString *msg /
|
||||
RCTLocationOptions _observerOptions;
|
||||
}
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
@synthesize bridge = _bridge;
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
@implementation RCTCameraRollManager
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (void)saveImageWithTag:(NSString *)imageTag successCallback:(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseSenderBlock)errorCallback
|
||||
{
|
||||
RCT_EXPORT();
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
@implementation RCTNetworkImageViewManager
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
RCTNetworkImageView *view = [[RCTNetworkImageView alloc] initWithFrame:CGRectZero imageDownloader:[RCTImageDownloader sharedInstance]];
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
@implementation RCTStaticImageManager
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
return [[RCTStaticImage alloc] init];
|
||||
|
||||
@@ -16,6 +16,8 @@ NSString *const RCTOpenURLNotification = @"RCTOpenURLNotification";
|
||||
|
||||
@implementation RCTLinkingManager
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
@synthesize bridge = _bridge;
|
||||
|
||||
- (instancetype)init
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -19,6 +19,8 @@ NSString *const RCTRemoteNotificationReceived = @"RemoteNotificationReceived";
|
||||
NSDictionary *_initialNotification;
|
||||
}
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
@synthesize bridge = _bridge;
|
||||
|
||||
- (instancetype)init
|
||||
|
||||
@@ -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])) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
@implementation RCTRawTextManager
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
return nil;
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
@implementation RCTTextManager
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
return [[RCTText alloc] init];
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
@implementation RCTVibration
|
||||
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (void)vibrate
|
||||
{
|
||||
RCT_EXPORT();
|
||||
|
||||
Reference in New Issue
Block a user