UNPKG

1.08 kBPlain TextView Raw
1#import <React/UIView+React.h>
2#import "RCTOnPageSelected.h"
3
4@implementation RCTOnPageSelected
5{
6 NSNumber* _position;
7 uint16_t _coalescingKey;
8}
9
10@synthesize viewTag = _viewTag;
11
12- (NSString *)eventName {
13 return @"onPageSelected";
14}
15
16- (instancetype) initWithReactTag:(NSNumber *)reactTag
17 position:(NSNumber *)position
18 coalescingKey:(uint16_t)coalescingKey;
19{
20 RCTAssertParam(reactTag);
21
22 if ((self = [super init])) {
23 _viewTag = reactTag;
24 _position = position;
25 _coalescingKey = coalescingKey;
26 }
27 return self;
28}
29
30RCT_NOT_IMPLEMENTED(- (instancetype)init)
31- (uint16_t)coalescingKey
32{
33 return _coalescingKey;
34}
35
36
37- (BOOL)canCoalesce
38{
39 return NO;
40}
41
42+ (NSString *)moduleDotMethod
43{
44 return @"RCTEventEmitter.receiveEvent";
45}
46
47- (NSArray *)arguments
48{
49 return @[self.viewTag, RCTNormalizeInputEventName(self.eventName), @{
50 @"position": _position,
51 }];
52}
53
54- (id<RCTEvent>)coalesceWithEvent:(id<RCTEvent>)newEvent;
55{
56 return newEvent;
57}
58
59@end
60