You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a sheet that is displayed ontop of another sheet in a SwiftUI view and the the top most sheet view is inside of a NavigationStack. Pre iOS 18 everything worked fine, but now the toolbar content does not display on the top most sheet view controller. Everything else in the stack displays just fine. I found out that a NavigationView works in place of the stack, however that is deprecated after 18.2. Is it possible this is a bug or am I doing something incorrectly with the view hierarchy?
/// Bottom sheet is already presented
Struct BottomSheetView {
@State var activateBottomSheet = false
var body: some View {
NavigationStack {
Button {
activateBottomSheet = true
}, label: {
Image(systemName: "slider.horizontal.3")
.foregroundColor(Color("text"))
}
.viewExtensionForPresentationForIssue(isPresented: $showGraphs) {
/// This is the topmost view controller view that has a NavigationStack and a toolbar attached that doesn't display. It WOULD display pre iOS 18
TopMostView()
}
}
}
}
extension View {
func viewExtensionForPresentationForIssue<C: View>(isPresented: Binding<Bool>,
@ViewBuilder content: @escaping () -> (C)) -> some View {
return
self.presentation(
transition: .sheet(
options: .init(detents: [.medium],
largestUndimmedDetentIdentifier: .medium)
),
isPresented: isPresented
) {
content()
}
}
}
The text was updated successfully, but these errors were encountered:
I have a sheet that is displayed ontop of another sheet in a SwiftUI view and the the top most sheet view is inside of a NavigationStack. Pre iOS 18 everything worked fine, but now the toolbar content does not display on the top most sheet view controller. Everything else in the stack displays just fine. I found out that a NavigationView works in place of the stack, however that is deprecated after 18.2. Is it possible this is a bug or am I doing something incorrectly with the view hierarchy?
The text was updated successfully, but these errors were encountered: