-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathRCTOnPageScrollEvent.m
60 lines (48 loc) · 1.06 KB
/
RCTOnPageScrollEvent.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#import <React/UIView+React.h>
#import "RCTOnPageScrollEvent.h"
@implementation RCTOnPageScrollEvent
{
NSNumber* _position;
NSNumber* _offset;
}
@synthesize viewTag = _viewTag;
- (NSString *)eventName {
return @"onPageScroll";
}
- (instancetype) initWithReactTag:(NSNumber *)reactTag
position:(NSNumber *)position
offset:(NSNumber *)offset;
{
RCTAssertParam(reactTag);
if ((self = [super init])) {
_viewTag = reactTag;
_position = position;
_offset = offset;
}
return self;
}
RCT_NOT_IMPLEMENTED(- (instancetype)init)
- (uint16_t)coalescingKey
{
return 0;
}
- (BOOL)canCoalesce
{
return YES;
}
+ (NSString *)moduleDotMethod
{
return @"RCTEventEmitter.receiveEvent";
}
- (NSArray *)arguments
{
return @[self.viewTag, RCTNormalizeInputEventName(self.eventName), @{
@"position": _position,
@"offset": _offset
}];
}
- (id<RCTEvent>)coalesceWithEvent:(id<RCTEvent>)newEvent;
{
return newEvent;
}
@end