I can navigate to next screen by using NavigationButton (push) or present with PresentationButton (present) but i want to push when i tap on Buttton()
Button
You need to use navigationBarBackButtonHidden by setting it true in your destination View like this below :-
struct ContentView: View {
var body: some View {
NavigationView {
NavigationButton(destination: DetailView()) {
Text("Click Me")
}.navigationBarTitle(Text("Header")) }
}
}
struct DetailView: View {
var body: some View {
Text("Detail View")
.navigationBarBackButtonHidden(true) //This will hide your back arrow button
}
}