Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion guides/GUIDE_FOR_LIBRARY_AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Using `containedModal` and `containedTransparentModal` with other types of modal

For iOS:

- `modal` will use [`UIModalPresentationAutomatic`](https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/uimodalpresentationautomatic?language=objc) on iOS 13 and later, and will use [`UIModalPresentationFullScreen`](https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/uimodalpresentationfullscreen?language=objc) on iOS 12 and earlier.
- `modal` will use [`UIModalPresentationAutomatic`](https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/uimodalpresentationautomatic?language=objc) on iOS 13 and later, and will use [`UIModalPresentationFullScreen`](https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/uimodalpresentationfullscreen?language=objc) on iOS 12 and earlier. For iOS 18 and later, additional prop `prefersPageSizing` will be set to `true` to ensure consistent behavior between iOS versions (`UIModalPresentationAutomatic` was mapped to `UIModalPresentationPageSheet` before iOS 18 but now it is mapped to `UIModalPresentationFormSheet`).
- `fullScreenModal` will use [`UIModalPresentationFullScreen`](https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/uimodalpresentationfullscreen?language=objc)
- `formSheet` will use [`UIModalPresentationFormSheet`](https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/uimodalpresentationformsheet?language=objc)
- `transparentModal` will use [`UIModalPresentationOverFullScreen`](https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/uimodalpresentationoverfullscreen?language=objc)
Expand Down
12 changes: 12 additions & 0 deletions ios/RNSScreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,18 @@ - (void)setStackPresentation:(RNSScreenStackPresentation)stackPresentation
}
#else
_controller.modalPresentationStyle = UIModalPresentationFullScreen;
#endif
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_17_0) && \
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_17_0 && !TARGET_OS_TV
if (@available(iOS 18.0, *)) {
UISheetPresentationController *sheetController = _controller.sheetPresentationController;
if (sheetController != nil) {
sheetController.prefersPageSizing = true;
} else {
RCTLogError(
@"[RNScreens] sheetPresentationController is null when attempting to set prefersPageSizing for modal");
}
}
#endif
break;
case RNSScreenStackPresentationFullScreenModal:
Expand Down
Loading