diff --git a/Examples/UIExplorer/UIExplorerUnitTests/RCTEventDispatcherTests.m b/Examples/UIExplorer/UIExplorerUnitTests/RCTEventDispatcherTests.m index e0406d497..d75f26445 100644 --- a/Examples/UIExplorer/UIExplorerUnitTests/RCTEventDispatcherTests.m +++ b/Examples/UIExplorer/UIExplorerUnitTests/RCTEventDispatcherTests.m @@ -18,22 +18,36 @@ #import #import "RCTEventDispatcher.h" -@interface RCTTestEvent : RCTBaseEvent - -@property (nonatomic, assign) BOOL canCoalesce; - +@interface RCTTestEvent : NSObject +@property (atomic, assign, readwrite) BOOL canCoalesce; @end @implementation RCTTestEvent +{ + NSDictionary *_body; +} + +@synthesize viewTag = _viewTag; +@synthesize eventName = _eventName; +@synthesize body = _body; +@synthesize coalescingKey = _coalescingKey; - (instancetype)initWithViewTag:(NSNumber *)viewTag eventName:(NSString *)eventName body:(NSDictionary *)body { - if (self = [super initWithViewTag:viewTag eventName:eventName body:body]) { - self.canCoalesce = YES; + if (self = [super init]) { + _viewTag = viewTag; + _eventName = eventName; + _body = body; + _canCoalesce = YES; } return self; } +- (id)coalesceWithEvent:(id)newEvent +{ + return newEvent; +} + + (NSString *)moduleDotMethod { return @"RCTDeviceEventEmitter.emit"; diff --git a/React/Base/RCTEventDispatcher.h b/React/Base/RCTEventDispatcher.h index 4cbd84fa2..6f7e7ac07 100644 --- a/React/Base/RCTEventDispatcher.h +++ b/React/Base/RCTEventDispatcher.h @@ -58,13 +58,6 @@ RCT_EXTERN NSString *RCTNormalizeInputEventName(NSString *eventName); @end -@interface RCTBaseEvent : NSObject - -- (instancetype)initWithViewTag:(NSNumber *)viewTag - eventName:(NSString *)eventName - body:(NSDictionary *)body NS_DESIGNATED_INITIALIZER; - -@end /** * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and diff --git a/React/Base/RCTEventDispatcher.m b/React/Base/RCTEventDispatcher.m index b0d2be661..4b2df3e9c 100644 --- a/React/Base/RCTEventDispatcher.m +++ b/React/Base/RCTEventDispatcher.m @@ -35,52 +35,6 @@ static NSNumber *RCTGetEventID(id event) ); } -@implementation RCTBaseEvent - -@synthesize viewTag = _viewTag; -@synthesize eventName = _eventName; -@synthesize body = _body; - -- (instancetype)initWithViewTag:(NSNumber *)viewTag - eventName:(NSString *)eventName - body:(NSDictionary *)body -{ - if (RCT_DEBUG) { - RCTAssertParam(eventName); - } - - if ((self = [super init])) { - _viewTag = viewTag; - _eventName = eventName; - _body = body; - } - return self; -} - -RCT_NOT_IMPLEMENTED(- (instancetype)init) - -- (uint16_t)coalescingKey -{ - return 0; -} - -- (BOOL)canCoalesce -{ - return YES; -} - -- (id)coalesceWithEvent:(id)newEvent -{ - return newEvent; -} - -+ (NSString *)moduleDotMethod -{ - return nil; -} - -@end - @interface RCTEventDispatcher() @end