Home > AI > IOS > SwiftUI >

TabView

ContentView.swift

struct ContentView: View {
    var body: some View {
        TabView {
            LearningView()
                .tabItem{
                    Image(systemName: "house")
                    Text("Learning")
                }.tag(0)
            ExperienceView()
                .tabItem{
                    Image(systemName: "cloud")
                    Text("Experience")
                }.tag(1)
            CommunityView()
                .tabItem{
                    Image(systemName: "clock")
                    Text("Community")
                }.tag(1)
            MeView()
                .tabItem{
                    Image(systemName: "person")
                    Text("Me")
                }.tag(1)
        }
    }
}

CommunityView.swift

struct CommunityView: View {
    var body: some View {
        Text("Community")
    }
}

Leave a Reply