Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created October 9, 2021 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/9965df40b6b570601759b6d963c20295 to your computer and use it in GitHub Desktop.
Save laevandus/9965df40b6b570601759b6d963c20295 to your computer and use it in GitHub Desktop.
struct ContentView: View {
@State private var selection: Tab = .schedule
enum Tab: Int {
case conversations, schedule, settings
}
var body: some View {
TabView(selection: $selection) {
ConversationListView()
.badge(1)
.tabItem {
Image(systemName: "bubble.left.and.bubble.right.fill")
Text("Messages")
}
.tag(Tab.conversations)
ScheduleView()
.tabItem {
Image(systemName: "clock.fill")
Text("Schedule")
}
.tag(Tab.schedule)
SettingsView()
.tabItem {
Image(systemName: "gearshape.fill")
Text("Settings")
}
.tag(Tab.settings)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment