Skip to content

Commit 9f5678d

Browse files
authored
feat(ios): drop support for curl transition style (#343) (#593)
* fix(ios): drop support for curl transition style * Update README
1 parent 61d68c3 commit 9f5678d

11 files changed

+9
-48
lines changed

MIGRATION.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Migration Guide
22

3+
# 5.x -> 6.x
4+
Due to some issues, support for the `transitionStyle` property, which was iOS only, has been dropped. In version **6.x** passing it will not have any effect.
5+
36
# 5.0.x -> 5.1.x
47
Before:
58
```js

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Lazy page loading has been added to the `next` version. If you would like to tes
2929

3030
## Migration
3131

32+
In version **6.x** support for `transitionStyle` property has been dropped. More information [here](https://github.com/callstack/react-native-pager-view/blob/master/MIGRATION.md).
33+
3234
`"@react-native-community/viewpager"` library has been changed to `react-native-pager-view`. Here you can find more information, how to migrate pager view to the latest [version](https://github.com/callstack/react-native-pager-view/blob/master/MIGRATION.md)
3335

3436
## Getting started
@@ -148,7 +150,6 @@ For advanced usage please take a look into our [example project](https://github.
148150
| `pageMargin: number` | Blank space to be shown between pages | both |
149151
| `keyboardDismissMode: ('none' / 'on-drag')` | Determines whether the keyboard gets dismissed in response to a drag | both |
150152
| `orientation: Orientation` | Set `horizontal` or `vertical` scrolling orientation (it does **not** work dynamically) | both |
151-
| `transitionStyle: TransitionStyle` | Use `scroll` or `curl` to change transition style (it does **not** work dynamically) | iOS |
152153
| `showPageIndicator: boolean` | Shows the dots indicator at the bottom of the view | iOS |
153154
| `overScrollMode: OverScollMode` | Used to override default value of overScroll mode. Can be `auto`, `always` or `never`. Defaults to `auto` | Android |
154155
| `offscreenPageLimit: number` | Set the number of pages that should be retained to either side of the currently visible page(s). Pages beyond this limit will be recreated from the adapter when needed. Defaults to RecyclerView's caching strategy. The given value must either be larger than 0. | Android |
@@ -185,13 +186,9 @@ requestAnimationFrame(() => refPagerView.current?.setPage(index));
185186

186187
### iOS
187188

188-
| horizontal - scroll | horizontal - curl |
189-
| :------------------------------------------------------------------: | :----------------------------------------------------------------: |
190-
| <img src="img/ios-viewpager-scroll.gif" alt="ViewPager" width="325"> | <img src="img/ios-viewpager-curl.gif" alt="ViewPager" width="325"> |
191-
192-
| vertical - scroll | vertical - curl |
193-
| :--------------------------------------------------------------------: | :-------------------------------------------------------------------------: |
194-
| <img src="img/ios-viewpager-vertical.gif" alt="ViewPager" width="325"> | <img src="img/ios-viewpager-vertical-curl.gif" alt="ViewPager" width="325"> |
189+
| horizontal | vertical |
190+
| :------------------------------------------------------------------: | :--------------------------------------------------------------------: |
191+
| <img src="img/ios-viewpager-scroll.gif" alt="ViewPager" width="325"> | <img src="img/ios-viewpager-vertical.gif" alt="ViewPager" width="325"> |
195192

196193
## Reanimated onPageScroll handler
197194

example/src/BasicPagerViewExample.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ export function BasicPagerViewExample() {
2929
pageMargin={10}
3030
// Lib does not support dynamically orientation change
3131
orientation="horizontal"
32-
// Lib does not support dynamically transitionStyle change
33-
transitionStyle="scroll"
3432
showPageIndicator={navigationPanel.dotsEnabled}
3533
>
3634
{useMemo(

example/src/NestPagerView.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function NestPagerView() {
1717
layoutDirection="ltr"
1818
pageMargin={10}
1919
orientation="horizontal"
20-
transitionStyle="scroll"
2120
>
2221
<View
2322
key="1"
@@ -37,8 +36,6 @@ export function NestPagerView() {
3736
pageMargin={10}
3837
// Lib does not support dynamically orientation change
3938
orientation="horizontal"
40-
// Lib does not support dynamically transitionStyle change
41-
transitionStyle="scroll"
4239
>
4340
<View
4441
key="1"
@@ -64,8 +61,6 @@ export function NestPagerView() {
6461
pageMargin={10}
6562
// Lib does not support dynamically orientation change
6663
orientation="vertical"
67-
// Lib does not support dynamically transitionStyle change
68-
transitionStyle="scroll"
6964
>
7065
<View
7166
key="1"

ios/PagerView.xcodeproj/project.pbxproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
18F5837025F79C300073D7CB /* ReactViewPagerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F5836025F79C300073D7CB /* ReactViewPagerManager.m */; };
1212
18F5837125F79C300073D7CB /* RCTConvert+UIPageViewControllerNavigationOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F5836125F79C300073D7CB /* RCTConvert+UIPageViewControllerNavigationOrientation.m */; };
1313
18F5837225F79C300073D7CB /* ReactNativePageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F5836225F79C300073D7CB /* ReactNativePageView.m */; };
14-
18F5837325F79C300073D7CB /* RCTConvert+UIPageViewControllerTransitionStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F5836425F79C300073D7CB /* RCTConvert+UIPageViewControllerTransitionStyle.m */; };
1514
18F5837425F79C300073D7CB /* RCTOnPageScrollStateChanged.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F5836625F79C300073D7CB /* RCTOnPageScrollStateChanged.m */; };
1615
18F5837525F79C300073D7CB /* RCTOnPageSelected.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F5836C25F79C300073D7CB /* RCTOnPageSelected.m */; };
1716
18F5837625F79C300073D7CB /* RCTOnPageScrollEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F5836E25F79C300073D7CB /* RCTOnPageScrollEvent.m */; };
@@ -37,7 +36,6 @@
3736
18F5836125F79C300073D7CB /* RCTConvert+UIPageViewControllerNavigationOrientation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+UIPageViewControllerNavigationOrientation.m"; sourceTree = "<group>"; };
3837
18F5836225F79C300073D7CB /* ReactNativePageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativePageView.m; sourceTree = "<group>"; };
3938
18F5836325F79C300073D7CB /* ReactViewPagerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReactViewPagerManager.h; sourceTree = "<group>"; };
40-
18F5836425F79C300073D7CB /* RCTConvert+UIPageViewControllerTransitionStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+UIPageViewControllerTransitionStyle.m"; sourceTree = "<group>"; };
4139
18F5836525F79C300073D7CB /* ReactNativePageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReactNativePageView.h; sourceTree = "<group>"; };
4240
18F5836625F79C300073D7CB /* RCTOnPageScrollStateChanged.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTOnPageScrollStateChanged.m; sourceTree = "<group>"; };
4341
18F5836725F79C300073D7CB /* RCTOnPageSelected.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTOnPageSelected.h; sourceTree = "<group>"; };
@@ -46,7 +44,6 @@
4644
18F5836A25F79C300073D7CB /* UIViewController+CreateExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+CreateExtension.h"; sourceTree = "<group>"; };
4745
18F5836B25F79C300073D7CB /* RCTOnPageScrollEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTOnPageScrollEvent.h; sourceTree = "<group>"; };
4846
18F5836C25F79C300073D7CB /* RCTOnPageSelected.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTOnPageSelected.m; sourceTree = "<group>"; };
49-
18F5836D25F79C300073D7CB /* RCTConvert+UIPageViewControllerTransitionStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+UIPageViewControllerTransitionStyle.h"; sourceTree = "<group>"; };
5047
18F5836E25F79C300073D7CB /* RCTOnPageScrollEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTOnPageScrollEvent.m; sourceTree = "<group>"; };
5148
B3E7B5891CC2AC0600A0062D /* PagerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PagerView.m; sourceTree = "<group>"; };
5249
F4FF95D5245B92E700C19C63 /* PagerView-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PagerView-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -77,8 +74,6 @@
7774
children = (
7875
18F5836925F79C300073D7CB /* RCTConvert+UIPageViewControllerNavigationOrientation.h */,
7976
18F5836125F79C300073D7CB /* RCTConvert+UIPageViewControllerNavigationOrientation.m */,
80-
18F5836D25F79C300073D7CB /* RCTConvert+UIPageViewControllerTransitionStyle.h */,
81-
18F5836425F79C300073D7CB /* RCTConvert+UIPageViewControllerTransitionStyle.m */,
8277
18F5836B25F79C300073D7CB /* RCTOnPageScrollEvent.h */,
8378
18F5836E25F79C300073D7CB /* RCTOnPageScrollEvent.m */,
8479
18F5836825F79C300073D7CB /* RCTOnPageScrollStateChanged.h */,
@@ -160,7 +155,6 @@
160155
18F5837525F79C300073D7CB /* RCTOnPageSelected.m in Sources */,
161156
18F5837225F79C300073D7CB /* ReactNativePageView.m in Sources */,
162157
18F5837025F79C300073D7CB /* ReactViewPagerManager.m in Sources */,
163-
18F5837325F79C300073D7CB /* RCTConvert+UIPageViewControllerTransitionStyle.m in Sources */,
164158
18F5837625F79C300073D7CB /* RCTOnPageScrollEvent.m in Sources */,
165159
F4FF95D7245B92E800C19C63 /* PagerView.swift in Sources */,
166160
18F5837425F79C300073D7CB /* RCTOnPageScrollStateChanged.m in Sources */,

ios/RCTConvert+UIPageViewControllerTransitionStyle.h

Lines changed: 0 additions & 10 deletions
This file was deleted.

ios/RCTConvert+UIPageViewControllerTransitionStyle.m

Lines changed: 0 additions & 11 deletions
This file was deleted.

ios/ReactNativePageView.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ NS_ASSUME_NONNULL_BEGIN
1616
@property(nonatomic, readonly) BOOL scrollEnabled;
1717
@property(nonatomic, readonly) BOOL showPageIndicator;
1818
@property(nonatomic, readonly) UIScrollViewKeyboardDismissMode dismissKeyboard;
19-
@property(nonatomic) UIPageViewControllerTransitionStyle transitionStyle;
2019
@property(nonatomic) UIPageViewControllerNavigationOrientation orientation;
2120
@property(nonatomic, copy) RCTDirectEventBlock onPageSelected;
2221
@property(nonatomic, copy) RCTDirectEventBlock onPageScroll;

ios/ReactNativePageView.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher {
3838
_scrollEnabled = YES;
3939
_pageMargin = 0;
4040
_lastReportedIndex = -1;
41-
_transitionStyle = UIPageViewControllerTransitionStyleScroll;
4241
_orientation = UIPageViewControllerNavigationOrientationHorizontal;
4342
_currentIndex = 0;
4443
_dismissKeyboard = UIScrollViewKeyboardDismissModeNone;
@@ -89,7 +88,7 @@ - (void)didMoveToWindow {
8988

9089
- (void)embed {
9190
NSDictionary *options = @{ UIPageViewControllerOptionInterPageSpacingKey: @(self.pageMargin) };
92-
UIPageViewController *pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:self.transitionStyle
91+
UIPageViewController *pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll
9392
navigationOrientation:self.orientation
9493
options:options];
9594
pageViewController.delegate = self;

ios/ReactViewPagerManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ @implementation ReactViewPagerManager
1010
RCT_EXPORT_VIEW_PROPERTY(initialPage, NSInteger)
1111
RCT_EXPORT_VIEW_PROPERTY(pageMargin, NSInteger)
1212

13-
RCT_EXPORT_VIEW_PROPERTY(transitionStyle, UIPageViewControllerTransitionStyle)
1413
RCT_EXPORT_VIEW_PROPERTY(orientation, UIPageViewControllerNavigationOrientation)
1514
RCT_EXPORT_VIEW_PROPERTY(onPageSelected, RCTDirectEventBlock)
1615
RCT_EXPORT_VIEW_PROPERTY(onPageScroll, RCTDirectEventBlock)

0 commit comments

Comments
 (0)