画面遷移Test
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
VStack{
HStack{
Text("Link : ")
NavigationLink(destination: SubView()) {
Text("SubView1")
}
}
HStack{
Text("Link : ")
NavigationLink(destination: SubView2()) {
Text("SubView2")
}
}
Spacer();
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
struct SubView: View {
var body: some View {
VStack {
Text("SubView")
}
.navigationBarTitle("SubView")
}
}
struct SubView2: View {
var body: some View {
VStack {
Text("SubView2")
}
.navigationBarTitle("SubView2")
}
}
댓글
댓글 쓰기