@@ -8,16 +8,14 @@ @interface RCTOnPageScrollEvent : NSObject <RCTEvent>
8
8
9
9
- (instancetype ) initWithReactTag : (NSNumber *)reactTag
10
10
position : (NSNumber *)position
11
- offset : (NSNumber *)offset
12
- coalescingKey : (uint16_t )coalescingKey ;
11
+ offset : (NSNumber *)offset ;
13
12
14
13
@end
15
14
16
15
@implementation RCTOnPageScrollEvent
17
16
{
18
17
NSNumber * _position;
19
18
NSNumber * _offset;
20
- uint16_t _coalescingKey;
21
19
}
22
20
23
21
@synthesize viewTag = _viewTag;
@@ -28,30 +26,28 @@ - (NSString *)eventName {
28
26
29
27
- (instancetype ) initWithReactTag : (NSNumber *)reactTag
30
28
position : (NSNumber *)position
31
- offset : (NSNumber *)offset
32
- coalescingKey : (uint16_t )coalescingKey ;
29
+ offset : (NSNumber *)offset ;
33
30
{
34
31
RCTAssertParam (reactTag);
35
32
36
33
if ((self = [super init ])) {
37
34
_viewTag = reactTag;
38
35
_position = position;
39
36
_offset = offset;
40
- _coalescingKey = coalescingKey;
41
37
}
42
38
return self;
43
39
}
44
40
45
41
RCT_NOT_IMPLEMENTED (- (instancetype )init)
46
42
- (uint16_t )coalescingKey
47
43
{
48
- return _coalescingKey ;
44
+ return 0 ;
49
45
}
50
46
51
47
52
48
- (BOOL )canCoalesce
53
49
{
54
- return NO ;
50
+ return YES ;
55
51
}
56
52
57
53
+ (NSString *)moduleDotMethod
@@ -426,7 +422,7 @@ - (void)pageViewController:(UIPageViewController *)pageViewController
426
422
_currentIndex = [_childrenViewControllers indexOfObject: currentVC];
427
423
[_eventDispatcher sendEvent: [[RCTOnPageSelected alloc ] initWithReactTag: self .reactTag position: [NSNumber numberWithInteger: _currentIndex] coalescingKey: _coalescingKey++]];
428
424
429
- [_eventDispatcher sendEvent: [[RCTOnPageScrollEvent alloc ] initWithReactTag: self .reactTag position: [NSNumber numberWithInteger: _currentIndex] offset: [NSNumber numberWithFloat: 0 ] coalescingKey: _coalescingKey++ ]];
425
+ [_eventDispatcher sendEvent: [[RCTOnPageScrollEvent alloc ] initWithReactTag: self .reactTag position: [NSNumber numberWithInteger: _currentIndex] offset: [NSNumber numberWithFloat: 0 ]]];
430
426
_reactPageIndicatorView.currentPage = _currentIndex;
431
427
}
432
428
}
@@ -522,7 +518,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
522
518
if (fabs (offset) > 1 ) {
523
519
offset = offset > 0 ? 1.0 : -1.0 ;
524
520
}
525
- [_eventDispatcher sendEvent: [[RCTOnPageScrollEvent alloc ] initWithReactTag: self .reactTag position: [NSNumber numberWithInteger: _currentIndex] offset: [NSNumber numberWithFloat: offset] coalescingKey: _coalescingKey++ ]];
521
+ [_eventDispatcher sendEvent: [[RCTOnPageScrollEvent alloc ] initWithReactTag: self .reactTag position: [NSNumber numberWithInteger: _currentIndex] offset: [NSNumber numberWithFloat: offset]]];
526
522
}
527
523
528
524
@end
0 commit comments