diff --git a/React/Base/RCTBridge.h b/React/Base/RCTBridge.h index 925a432bd..18cf73876 100644 --- a/React/Base/RCTBridge.h +++ b/React/Base/RCTBridge.h @@ -145,17 +145,6 @@ RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass); */ @property (nonatomic, weak, readonly) id delegate; -/** - * The event dispatcher is a wrapper around -enqueueJSCall:args: that provides a - * higher-level interface for sending UI events such as touches and text input. - * - * NOTE: RCTEventDispatcher is now a bridge module, this is implemented as a - * category but remains declared in the bridge to avoid breaking changes - * - * To be moved. - */ -@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; - /** * The launch options that were used to initialize the bridge. */ diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index baf28d65f..dceaf4409 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -209,11 +209,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) return [self.batchedBridge moduleIsInitialized:moduleClass]; } -- (RCTEventDispatcher *)eventDispatcher -{ - return [self moduleForClass:[RCTEventDispatcher class]]; -} - - (void)reload { /** diff --git a/React/Base/RCTEventDispatcher.h b/React/Base/RCTEventDispatcher.h index 02fd28356..105bb2def 100644 --- a/React/Base/RCTEventDispatcher.h +++ b/React/Base/RCTEventDispatcher.h @@ -103,3 +103,9 @@ RCT_EXTERN NSString *RCTNormalizeInputEventName(NSString *eventName); - (void)sendEvent:(id)event; @end + +@interface RCTBridge (RCTEventDispatcher) + +- (RCTEventDispatcher *)eventDispatcher; + +@end diff --git a/React/Base/RCTEventDispatcher.m b/React/Base/RCTEventDispatcher.m index fd3997c8d..18a6c9f44 100644 --- a/React/Base/RCTEventDispatcher.m +++ b/React/Base/RCTEventDispatcher.m @@ -189,3 +189,12 @@ RCT_EXPORT_MODULE() } @end + +@implementation RCTBridge (RCTEventDispatcher) + +- (RCTEventDispatcher *)eventDispatcher +{ + return [self moduleForClass:[RCTEventDispatcher class]]; +} + +@end