Skip to content

Commit 7be96f1

Browse files
authored
feat(ios): lazy pager (iOS native side) (#332)
* feat(ios): lazy view renderer * docs: remove unimplemented note (lazy pager is implemented) * fix: unneeded renders when using initialPage without maxRenderWindow * chore(ios): replace `self.` access with `_` * fix(ios): initial page can fail correct layout on first render
1 parent 680b458 commit 7be96f1

File tree

6 files changed

+263
-372
lines changed

6 files changed

+263
-372
lines changed

example/src/BasicPagerViewExample.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ export function BasicPagerViewExample() {
2626
onPageSelected={navigationPanel.onPageSelected}
2727
onPageScrollStateChanged={navigationPanel.onPageScrollStateChanged}
2828
pageMargin={10}
29-
// Lib does not support dynamically orientation change
3029
orientation="horizontal"
31-
// Lib does not support dynamically transitionStyle change
3230
transitionStyle="scroll"
3331
showPageIndicator={navigationPanel.dotsEnabled}
3432
>

ios/ReactNativePageView.h

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,23 @@ NS_ASSUME_NONNULL_BEGIN
77

88
@interface ReactNativePageView: UIView
99

10-
- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher;
10+
- (instancetype)init;
1111

12-
@property(nonatomic) NSInteger initialPage;
13-
@property(nonatomic) NSInteger lastReportedIndex;
14-
@property(nonatomic) NSInteger currentIndex;
12+
@property(nonatomic) NSInteger count;
13+
@property(nonatomic) NSInteger offset;
14+
@property(nonatomic) UIPageViewControllerNavigationOrientation orientation;
15+
@property(nonatomic) BOOL overdrag;
1516
@property(nonatomic) NSInteger pageMargin;
16-
@property(nonatomic, readonly) BOOL scrollEnabled;
17-
@property(nonatomic, readonly) BOOL showPageIndicator;
18-
@property(nonatomic, readonly) UIScrollViewKeyboardDismissMode dismissKeyboard;
17+
@property(nonatomic) BOOL scrollEnabled;
18+
@property(nonatomic) BOOL showPageIndicator;
1919
@property(nonatomic) UIPageViewControllerTransitionStyle transitionStyle;
20-
@property(nonatomic) UIPageViewControllerNavigationOrientation orientation;
20+
2121
@property(nonatomic, copy) RCTDirectEventBlock onPageSelected;
2222
@property(nonatomic, copy) RCTDirectEventBlock onPageScroll;
2323
@property(nonatomic, copy) RCTDirectEventBlock onPageScrollStateChanged;
24-
@property(nonatomic) BOOL overdrag;
25-
2624

2725
- (void)goTo:(NSInteger)index animated:(BOOL)animated;
2826
- (void)shouldScroll:(BOOL)scrollEnabled;
29-
- (void)shouldShowPageIndicator:(BOOL)showPageIndicator;
30-
- (void)shouldDismissKeyboard:(NSString *)dismissKeyboard;
3127

3228
@end
3329

0 commit comments

Comments
 (0)