File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
21
21
@property (nonatomic ) UIPageViewControllerNavigationOrientation orientation;
22
22
@property (nonatomic , copy ) RCTBubblingEventBlock onPageSelected;
23
23
@property (nonatomic , copy ) RCTBubblingEventBlock onPageScroll;
24
+ @property (nonatomic , copy ) RCTBubblingEventBlock onPageScrollStateChanged;
25
+
24
26
25
27
- (void )goTo : (NSNumber *)index animated : (BOOL )animated ;
26
28
- (void )shouldScroll : (BOOL )scrollEnabled ;
Original file line number Diff line number Diff line change @@ -279,6 +279,18 @@ - (UIPageControl *)createPageIndicator:(UIView *)parentView {
279
279
280
280
#pragma mark - UIScrollViewDelegate
281
281
282
+ - (void )scrollViewWillBeginDragging : (UIScrollView *)scrollView {
283
+ _onPageScrollStateChanged (@{@" pageScrollState" : @" dragging" });
284
+ }
285
+
286
+ - (void )scrollViewWillEndDragging : (UIScrollView *)scrollView withVelocity : (CGPoint)velocity targetContentOffset : (inout CGPoint *)targetContentOffset {
287
+ _onPageScrollStateChanged (@{@" pageScrollState" : @" settling" });
288
+ }
289
+
290
+ - (void )scrollViewDidEndDecelerating : (UIScrollView *)scrollView {
291
+ _onPageScrollStateChanged (@{@" pageScrollState" : @" idle" });
292
+ }
293
+
282
294
- (void )scrollViewDidScroll : (UIScrollView *)scrollView {
283
295
CGPoint point = scrollView.contentOffset ;
284
296
float offset = (point.x - self.frame .size .width )/self.frame .size .width ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ @implementation ReactViewPagerManager
14
14
RCT_EXPORT_VIEW_PROPERTY(orientation, UIPageViewControllerNavigationOrientation)
15
15
RCT_EXPORT_VIEW_PROPERTY(onPageSelected, RCTBubblingEventBlock)
16
16
RCT_EXPORT_VIEW_PROPERTY(onPageScroll, RCTBubblingEventBlock)
17
+ RCT_EXPORT_VIEW_PROPERTY(onPageScrollStateChanged, RCTBubblingEventBlock)
17
18
18
19
- (void ) goToPage
19
20
: (nonnull NSNumber *)reactTag index
You can’t perform that action at this time.
0 commit comments