Skip to content

Commit

Permalink
RCTTouchEvent's init takes coalescing key
Browse files Browse the repository at this point in the history
Reviewed By: javache

Differential Revision: D3092861

fb-gh-sync-id: 69beb58c0a2ca3fe33712a57098c8b7300ad49f4
fbshipit-source-id: 69beb58c0a2ca3fe33712a57098c8b7300ad49f4
  • Loading branch information
majak authored and Facebook Github Bot 8 committed Apr 1, 2016
1 parent cefc5a6 commit 7c2b397
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion React/Base/RCTTouchEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@

- (instancetype)initWithEventName:(NSString *)eventName
reactTouches:(NSArray<NSDictionary *> *)reactTouches
changedIndexes:(NSArray<NSNumber *> *)changedIndexes NS_DESIGNATED_INITIALIZER;
changedIndexes:(NSArray<NSNumber *> *)changedIndexes
coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER;
@end
9 changes: 8 additions & 1 deletion React/Base/RCTTouchEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@ @implementation RCTTouchEvent
{
NSArray<NSDictionary *> *_reactTouches;
NSArray<NSNumber *> *_changedIndexes;
uint16_t _coalescingKey;
}

@synthesize eventName = _eventName;
@synthesize viewTag = _viewTag;
@synthesize coalescingKey = _coalescingKey;

- (instancetype)initWithEventName:(NSString *)eventName
reactTouches:(NSArray<NSDictionary *> *)reactTouches
changedIndexes:(NSArray<NSNumber *> *)changedIndexes
coalescingKey:(uint16_t)coalescingKey
{
if (self = [super init]) {
_eventName = eventName;
_reactTouches = reactTouches;
_changedIndexes = changedIndexes;
_coalescingKey = coalescingKey;
}
return self;
}
Expand Down Expand Up @@ -75,4 +77,9 @@ - (NSArray *)arguments
return @[RCTNormalizeInputEventName(_eventName), _reactTouches, _changedIndexes];
}

- (uint16_t)coalescingKey
{
return _coalescingKey;
}

@end
3 changes: 2 additions & 1 deletion React/Base/RCTTouchHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ - (void)_updateAndDispatchTouches:(NSSet<UITouch *> *)touches

RCTTouchEvent *event = [[RCTTouchEvent alloc] initWithEventName:eventName
reactTouches:reactTouches
changedIndexes:changedIndexes];
changedIndexes:changedIndexes
coalescingKey:0];
[_eventDispatcher sendEvent:event];
}

Expand Down

0 comments on commit 7c2b397

Please sign in to comment.