File tree Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ -(void)prepareForRecycle {
122
122
}
123
123
124
124
- (void )shouldDismissKeyboard : (RNCViewPagerKeyboardDismissMode)dismissKeyboard {
125
+ #if !TARGET_OS_VISION
125
126
UIScrollViewKeyboardDismissMode dismissKeyboardMode = UIScrollViewKeyboardDismissModeNone;
126
127
switch (dismissKeyboard) {
127
128
case RNCViewPagerKeyboardDismissMode::None:
@@ -132,6 +133,7 @@ - (void)shouldDismissKeyboard:(RNCViewPagerKeyboardDismissMode)dismissKeyboard {
132
133
break ;
133
134
}
134
135
scrollView.keyboardDismissMode = dismissKeyboardMode;
136
+ #endif
135
137
}
136
138
137
139
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ NS_ASSUME_NONNULL_BEGIN
15
15
@property (nonatomic ) NSInteger currentIndex;
16
16
@property (nonatomic ) NSInteger pageMargin;
17
17
@property (nonatomic , readonly ) BOOL scrollEnabled;
18
+ #if !TARGET_OS_VISION
18
19
@property (nonatomic , readonly ) UIScrollViewKeyboardDismissMode dismissKeyboard;
20
+ #endif
19
21
@property (nonatomic ) UIPageViewControllerNavigationOrientation orientation;
20
22
@property (nonatomic , copy ) RCTDirectEventBlock onPageSelected;
21
23
@property (nonatomic , copy ) RCTDirectEventBlock onPageScroll;
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher {
41
41
_destinationIndex = -1 ;
42
42
_orientation = UIPageViewControllerNavigationOrientationHorizontal;
43
43
_currentIndex = 0 ;
44
+ #if !TARGET_OS_VISION
44
45
_dismissKeyboard = UIScrollViewKeyboardDismissModeNone;
46
+ #endif
45
47
_coalescingKey = 0 ;
46
48
_eventDispatcher = eventDispatcher;
47
49
_cachedControllers = [NSHashTable hashTableWithOptions: NSHashTableStrongMemory ];
@@ -102,7 +104,9 @@ - (void)embed {
102
104
for (UIView *subview in pageViewController.view .subviews ) {
103
105
if ([subview isKindOfClass: UIScrollView.class]){
104
106
((UIScrollView *)subview).delegate = self;
107
+ #if !TARGET_OS_VISION
105
108
((UIScrollView *)subview).keyboardDismissMode = _dismissKeyboard;
109
+ #endif
106
110
((UIScrollView *)subview).delaysContentTouches = YES ;
107
111
self.scrollView = (UIScrollView *)subview;
108
112
}
@@ -128,9 +132,11 @@ - (void)shouldScroll:(BOOL)scrollEnabled {
128
132
}
129
133
130
134
- (void )shouldDismissKeyboard : (NSString *)dismissKeyboard {
135
+ #if !TARGET_OS_VISION
131
136
_dismissKeyboard = [dismissKeyboard isEqual: @" on-drag" ] ?
132
137
UIScrollViewKeyboardDismissModeOnDrag : UIScrollViewKeyboardDismissModeNone;
133
138
self.scrollView .keyboardDismissMode = _dismissKeyboard;
139
+ #endif
134
140
}
135
141
136
142
- (void )setupInitialController {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
s . license = package [ "license" ]
12
12
s . authors = package [ "author" ]
13
13
14
- s . platforms = { :ios => "10.0" }
14
+ s . platforms = { :ios => "10.0" , :visionos => "1.0" }
15
15
s . source = { :git => "https://github.com/callstack/react-native-pager-view.git" , :tag => "#{ s . version } " }
16
16
17
17
s . source_files = "ios/**/*.{h,m,mm}"
You can’t perform that action at this time.
0 commit comments