diff --git a/apps/ios/Shared/Views/Helpers/AppSheet.swift b/apps/ios/Shared/Views/Helpers/AppSheet.swift index 4b95018e71..07fbffd0bd 100644 --- a/apps/ios/Shared/Views/Helpers/AppSheet.swift +++ b/apps/ios/Shared/Views/Helpers/AppSheet.swift @@ -66,23 +66,37 @@ extension View { } struct NavStackWorkaround : View { - let isPresented: Binding + let path: Binding<[Bool]> let destination: () -> D let content: () -> C var body: some View { if #available(iOS 16, *) { - NavigationStack { - content() - .navigationDestination(isPresented: isPresented) { - destination() - .navigationBarTitleDisplayMode(.inline) - .navigationBarBackButtonHidden(true) + NavigationStack(path: path) { + ZStack { + NavigationLink(value: true) { + EmptyView() + } + content() + } + .navigationDestination(for: Bool.self) { show in + if show { destination() } } } } else { - NavigationView(content: content) - .navigationViewStyle(.stack) + NavigationView { + ZStack { + NavigationLink( + destination: destination(), + isActive: Binding( + get: { !path.wrappedValue.isEmpty }, + set: { _ in } + ) + ) { EmptyView() } + content() + } + } + .navigationViewStyle(.stack) } } }