Any chance of some backport love for the `isPresented` overload of `navigationDestination`?
From the SwiftUI interface (documentation link):
/// Associates a destination view with a binding that can be used to push
/// the view onto a ``NavigationStack``.
///
/// In general, favor binding a path to a navigation stack for programmatic
/// navigation. Add this view modifer to a view inside a ``NavigationStack``
/// to programmatically push a single view onto the stack. This is useful
/// for building components that can push an associated view. For example,
/// you can present a `ColorDetail` view for a particular color:
///
/// @State private var showDetails = false
/// var favoriteColor: Color
///
/// NavigationStack {
/// VStack {
/// Circle()
/// .fill(favoriteColor)
/// Button("Show details") {
/// showDetails = true
/// }
/// }
/// .navigationDestination(isPresented: $showDetails) {
/// ColorDetail(color: favoriteColor)
/// }
/// .navigationTitle("My Favorite Color")
/// }
///
/// Do not put a navigation destination modifier inside a "lazy" container,
/// like ``List`` or ``LazyVStack``. These containers create child views
/// only when needed to render on screen. Add the navigation destination
/// modifier outside these containers so that the navigation stack can
/// always see the destination.
///
/// - Parameters:
/// - isPresented: A binding to a Boolean value that indicates whether
/// `destination` is currently presented.
/// - destination: A view to present.
public func navigationDestination<V>(isPresented: Binding<Bool>, @ViewBuilder destination: () -> V) -> some View where V : View
I'd offer to do a PR but I feel I'm a bit out of my depth here.
Thanks for raising this issue @kielgillard - this API had completely escaped my notice! When I have a chance, I'll see if it can be accommodated in NavigationBackport.
+1 for this :D
I finally spent some time on this and have made good progress, so I'll try to merge it in soon.
+1
It took a while but I've added support for this in v0.7.0. Please let me know if you find any issues with it.