struct ViewA: View { @State private var isShowingViewB = false var body: some View { VStack { Button("Show View B") { isShowingViewB = true } NavigationLink( isActive: $isShowingViewB, destination: { ViewB() }, label: { EmptyView() } ) } } }
struct ViewA: View { @State private var isShowingViewB = false var body: some View { VStack { Button("Show View B") { isShowingViewB = true } NavigationLink( isActive: $isShowingViewB, destination: { ViewB() }, label: { EmptyView() } ) } } }