Learning Time : 30min

My Github : Hot Prospects Source Code

My Note index link

day82.png

KeyWords

Building out tab bar

Step 1: Create ProspectsView and MeView

struct ProspectsView: View {
    var body: some View {
        Text("Hello, World!")
    }
}

struct MeView: View {
    var body: some View {
        Text("Hello, World!")
    }
}

Step2: Implement ContentView with TabView

struct ContentView: View {
    var body: some View {
        TabView {
            ProspectsView()
                .tabItem {
                    Label("Everyone", systemImage: "person.3")
                }
            ProspectsView()
                .tabItem {
                    Label("Contacted", systemImage: "checkmark.circle")
                }
            ProspectsView()
                .tabItem {
                    Label("Uncontacted", systemImage: "questionmark.diamond")
                }
            MeView()
                .tabItem {
                    Label("Me", systemImage: "person.crop.square")
                }
        }
    }
}