Toolbar Display Bug When Using Zoom NavigationTransition with Swipe-Back Gesture

Could anyone help confirm if this is a bug and suggest possible solutions? Thanksssss

In iOS 18, when using Zoom NavigationTransition, the toolbar from the destination view may randomly appear on the source view after navigating back with the swipe-back gesture.

Re-entering the destination view and navigating back again can temporarily resolve the issue, but it may still occur intermittently.

This bug only happens with Zoom NavigationTransition and does not occur when using a button tap to navigate back.

import SwiftUI

struct test: View {
    @Namespace private var namespace

    var body: some View {
        NavigationStack {
            NavigationLink {
                Image("img1")
                    .resizable()
                    .navigationTransition(.zoom(sourceID: 1, in: namespace))
                    .toolbar {
                        ToolbarItem(placement: .bottomBar) {
                            Text("destination noDisappear")
                        }
                    }
            } label: {
                Image("img1")
                    .resizable()
                    .frame(width: 100, height: 100)
                    .matchedTransitionSource(id: 1, in: namespace)
                    .toolbar {
                        ToolbarItem(placement: .bottomBar) {
                            Text("source toolbar")
                        }
                    }
            }
        }
    }
}

Thanks for flagging this @wbin3000. That's sounds like a bug.

I'd greatly appreciate it if you could open a bug report, include the code snippet to reproduce the issue and your test environment. Post the FB number here once you do.

Bug Reporting: How and Why? has tips on creating your bug report.

Toolbar Display Bug When Using Zoom NavigationTransition with Swipe-Back Gesture
 
 
Q