Skip to content

Commit 7903fe9

Browse files
committed
Add compile-time check
1 parent 8e649fc commit 7903fe9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ios/gamma/modals/form-sheet/RNSFormSheetHostComponentView.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import "RNSFormSheetHostComponentView.h"
2+
#import "RNSDefines.h"
23
#import "RNSFormSheetHostComponentEventEmitter.h"
34
#import "RNSFormSheetHostController.h"
45
#import "RNSFormSheetHostShadowStateProxy.h"
@@ -265,6 +266,7 @@ - (void)updateConfiguration
265266
NSMutableArray<UISheetPresentationControllerDetent *> *nativeDetents =
266267
[[NSMutableArray alloc] initWithCapacity:capacity];
267268

269+
#if RNS_IPHONE_OS_VERSION_AVAILABLE(16_0)
268270
if (@available(iOS 16.0, *)) {
269271
if (detentsCount == 0) {
270272
[nativeDetents addObject:[UISheetPresentationControllerDetent largeDetent]];
@@ -282,7 +284,9 @@ - (void)updateConfiguration
282284
}]];
283285
}
284286
}
285-
} else {
287+
} else
288+
#endif // RNS_IPHONE_OS_VERSION_AVAILABLE(16_0)
289+
{
286290
// iOS 15 Legacy Fallback
287291
if (detentsCount == 1) {
288292
double firstDetentFraction = _detents[0];

0 commit comments

Comments
 (0)