@@ -327,7 +327,7 @@ final class NavigationHierarchyControllerTests: XCTestCase {
327
327
path: " /new " ,
328
328
context: . modal,
329
329
additionalProperties: [
330
- " modal_style " : " formSheet "
330
+ " modal_style " : " form_sheet "
331
331
] )
332
332
navigator. route ( proposal)
333
333
XCTAssertEqual ( modalNavigationController. modalPresentationStyle, . formSheet)
@@ -339,9 +339,16 @@ final class NavigationHierarchyControllerTests: XCTestCase {
339
339
context: . modal
340
340
)
341
341
navigator. route ( proposal)
342
- // NOTE: For most view controllers, UIKit maps `automatic` style to the UIModalPresentationStyle.pageSheet style,
343
- // but some system view controllers may map it to a different style.
344
- XCTAssertEqual ( modalNavigationController. modalPresentationStyle, . pageSheet)
342
+ // For most view controllers, UIKit maps [automatic] to:
343
+ // UIModalPresentationStyle.formSheet in iOS 18 and later
344
+ // UIModalPresentationStyle.pageSheet in versions of iOS earlier than iOS 18
345
+ // Some system view controllers may map it to a different style.
346
+ // https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/automatic
347
+ if #available( iOS 18 , * ) {
348
+ XCTAssertEqual ( modalNavigationController. modalPresentationStyle, . formSheet)
349
+ } else {
350
+ XCTAssertEqual ( modalNavigationController. modalPresentationStyle, . pageSheet)
351
+ }
345
352
}
346
353
347
354
func test_modalDismissGestureEnabled_isCorrectlySet( ) throws {
0 commit comments