Skip to content

Commit cca654a

Browse files
committed
fix: visionOS builds
1 parent ea11c94 commit cca654a

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

ios/RNCPagerScrollView.h

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ NOTE: This file is *not* currently used, for context see:
33
- https://github.com/callstack/react-native-pager-view/pull/783#discussion_r1410295171
44
- https://github.com/callstack/react-native-pager-view/pull/783#discussion_r1410316201
55
*/
6+
#include <UIKit/UIKit.h>
67

78
@interface RNCPagerScrollView : UIScrollView <UIGestureRecognizerDelegate>
89
@end

ios/RNCPagerView.h

+2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ NS_ASSUME_NONNULL_BEGIN
1111

1212
@property(nonatomic) NSInteger initialPage;
1313
@property(nonatomic) NSString* orientation;
14+
#if !TARGET_OS_VISION
1415
@property(nonatomic, readonly) UIScrollViewKeyboardDismissMode dismissKeyboard;
16+
#endif
1517
@property(nonatomic, copy) RCTDirectEventBlock onPageSelected;
1618
@property(nonatomic, copy) RCTDirectEventBlock onPageScroll;
1719
@property(nonatomic, copy) RCTDirectEventBlock onPageScrollStateChanged;

ios/RNCPagerView.m

+4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ @implementation RNCPagerView {
3030
- (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher {
3131
if (self = [super init]) {
3232
_initialPage = 0;
33+
#if !TARGET_OS_VISION
3334
_dismissKeyboard = UIScrollViewKeyboardDismissModeNone;
35+
#endif
3436
_coalescingKey = 0;
3537
_eventDispatcher = eventDispatcher;
3638
_orientation = @"horizontal";
@@ -89,11 +91,13 @@ - (void)shouldScroll:(BOOL)scrollEnabled {
8991
}
9092
}
9193

94+
#if !TARGET_OS_VISION
9295
- (void)shouldDismissKeyboard:(NSString *)dismissKeyboard {
9396
_dismissKeyboard = [dismissKeyboard isEqual: @"on-drag"] ?
9497
UIScrollViewKeyboardDismissModeOnDrag : UIScrollViewKeyboardDismissModeNone;
9598
self.scrollView.keyboardDismissMode = _dismissKeyboard;
9699
}
100+
#endif
97101

98102
#pragma mark - Internal methods
99103

0 commit comments

Comments
 (0)