Skip to content

BottomSheet: replace presentationMode / NavigationView / navigationBarHidden at the iOS 18 floor #24

Open

Description

@romchornyi

Summary

BottomSheet still uses three SwiftUI APIs from before iOS 16. With the iOS 18 floor from #15 they all have replacements:

Where Now Replacement
BottomSheet.swift:8, :157 @Environment(\.presentationMode) + presentationMode.wrappedValue.dismiss() @Environment(\.dismiss) (iOS 15)
BottomSheet.swift:169 (fillsHeight path) NavigationView { … } NavigationStack (iOS 16), or no navigation container at all
BottomSheet.swift:172 .navigationBarHidden(true) .toolbar(.hidden, for: .navigationBar)

presentationMode and NavigationView are soft-deprecated.

Why it was not done in #15

#15 only removes fallback paths that never ran on iOS 18, so the change has no behaviour impact. This one is different. NavigationView → NavigationStack can change how sheet content is laid out: safe-area and toolbar insets, plus the background behind the hidden bar. Each fillsHeight sheet in dashwallet-ios needs a visual check.

What to check

  • Does the fillsHeight path need a navigation container at all? If it is only there to hide the bar or to give the content full height, drop it entirely rather than swapping it.
  • Before/after screenshots of the fillsHeight sheets in dashwallet-ios, in light and dark mode, with the keyboard up and down.
  • BottomSheetCloseAction.perform works the same with dismiss(). BottomSheetTests covers the decision logic.
  • The navigation-and-containers.md docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions