You create the files in the project as I explained in the other thread.
The struct will be named FirstTabView and SecondTabView.
Those files content will look like this:
FirstTabView.swift
import SwiftUI
struct FirstTabView: View {
var body: some View {
Text("Hello, FirstTabView!")
}
}
struct FirstTabView_Previews: PreviewProvider {
static var previews: some View {
MySwiftUIView()
}
}
and SecondTabView.swift
import SwiftUI
struct SecondTabView: View {
var body: some View {
Text("Hello, SecondTabView!")
}
}
struct SecondTabView_Previews: PreviewProvider {
static var previews: some View {
MySwiftUIView()
}
}
The connection to the tabBar is made by this code in the parent View (the one which will contain the tabbar)
TabView {
FirstTabView()
.tabItem {
Label("1st", systemImage: "list.dash")
}