Я пытаюсь связать действие кнопки в SomeView1 (), чтобы перейти к someView2 () без кнопки «Назад» в верхней части экрана. Вместо этого я хочу добавить еще одну кнопку в SomeView2 (), которая вернется к SomeView1 (). это возможно в SwiftUI еще?
SomeView1 ()
struct SomeView1: View {
var body: some View {
NavigationView {
VStack {
//...view's content
NavigationLink(destination: SomeView2()) {
Text("go to SomeView2")
}
Spacer()
}
}
}
}
SomeView2 ()
struct SomeView2: View {
var body: some View {
NavigationView {
VStack {
//...view's content
NavigationLink(destination: SomeView1()) {
Text("go to SomeView1")
}
Spacer()
}
}
}
}
это выглядит так: 