I have two views. View1 has a NavigationLink which leads to View2. However the "Back" Button to get back to View1 only says "Back" and not the title of View1.
How can I change the Buttons Text without creating a button via NavigationBarItems? Adding a Button via NavigationBarItems removes the animation when the second view shows up.
struct View1: View {
var body: some View {
NavigationView {
List {
Text("ExampleText1")
Text("ExampleText2")
}
.navigationBarTitle("View1")
.navigationBarItems(
trailing:
NavigationLink(destination: View2()) {
Image(systemName: "plus.circle").font(.system(size: 25))
})
}
}
}
struct View2: View {
var body: some View {
List {
Text("Example")
Text("Example")
}
.navigationBarTitle("View2")
}
}