Zoom navigation transitions for tabViewBottomAccessory are not working in SwiftUI with ObservableObject or Observable

The zoom navigation transition with matchedTransitionSource in tabViewBottomAccessory does not work when a Published var in an ObservableObjector Observable gets changed.

Here is an minimal reproducible example with ObservableObject:

import SwiftUI
import Combine

private final class ViewModel: ObservableObject {
    @Published var isPresented = false
}

struct ContentView: View {
    @Namespace private var namespace
    
    @StateObject private var viewModel = ViewModel()
//    @State private var isPresented = false
    
    var body: some View {
        TabView {
            Button {
                viewModel.isPresented = true
            } label: {
                Text("Start")
            }
            .tabItem {
                Image(systemName: "house")
                Text("Home")
            }

            Text("Search")
                .tabItem {
                    Image(systemName: "magnifyingglass")
                    Text("Search")
                }

            Text("Profile")
                .tabItem {
                    Image(systemName: "person")
                    Text("Profile")
                }
        }
        .sheet(isPresented: $viewModel.isPresented) {
            Text("Sheet")
                .presentationDragIndicator(.visible)
                .navigationTransition(.zoom(sourceID: "tabViewBottomAccessoryTransition", in: namespace))
        }
        .tabViewBottomAccessory {
            Button {
                viewModel.isPresented = true
            } label: {
                Text("BottomAccessory")
            }
            .matchedTransitionSource(id: "tabViewBottomAccessoryTransition", in: namespace)
        }
    }
}

However, when using only a State property everything works:

import SwiftUI
import Combine

private final class ViewModel: ObservableObject {
    @Published var isPresented = false
}

struct ContentView: View {
    @Namespace private var namespace
    
    //    @StateObject private var viewModel = ViewModel()
    @State private var isPresented = false
    
    var body: some View {
        TabView {
            Button {
                isPresented = true
            } label: {
                Text("Start")
            }
            .tabItem {
                Image(systemName: "house")
                Text("Home")
            }
            
            Text("Search")
                .tabItem {
                    Image(systemName: "magnifyingglass")
                    Text("Search")
                }
            
            Text("Profile")
                .tabItem {
                    Image(systemName: "person")
                    Text("Profile")
                }
        }
        .sheet(isPresented: $isPresented) {
            Text("Sheet")
                .presentationDragIndicator(.visible)
                .navigationTransition(.zoom(sourceID: "tabViewBottomAccessoryTransition", in: namespace))
        }
        .tabViewBottomAccessory {
            Button {
                isPresented = true
            } label: {
                Text("BottomAccessory")
            }
            .matchedTransitionSource(id: "tabViewBottomAccessoryTransition", in: namespace)
        }
    }
}

I ran into the same issue, and it appears that SwiftUI requires the isPresented state to be mutated directly in the view that acts as the transition source.

@Gipfeli Could you please file a Feedback Report, include the sample code and steps to reproduce the issue. Please share the feedback ID number here for the record.

@DTS Engineer Thank you, I have filed a Feedback Report. The feedback ID is: FB21630194

Accepted Answer

I can't reproduce the bug anymore on iOS 26.3.

@Gipfeli Interesting. Issue reproduces for me here on 26.4b1 (device).

Still not fixed in iOS 26.4

Thank you for the update Damian, however the report listed on this thread appears to be closed.

Can you file a new report for this issue and share a minimal code a reproduces this issue? If it's the same code as above feel free to link to this thread.

I would like to confirm if this is the same issue or not, and want to share these details with the relevant engineering team. File your report here https://developer.apple.com/feedback-assistant/

Once complete reply with the FB number.

 Travis

Zoom navigation transitions for tabViewBottomAccessory are not working in SwiftUI with ObservableObject or Observable
 
 
Q