Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Created May 4, 2020 06:31
Show Gist options
  • Save Dimillian/3e34f1a5bfb4c79bc8512b439baf9889 to your computer and use it in GitHub Desktop.
Save Dimillian/3e34f1a5bfb4c79bc8512b439baf9889 to your computer and use it in GitHub Desktop.
struct TabbarView: View {
private enum Tab: Int {
case dashboard, items, villagers, collection, turnips
}
@State private var selectedTab = Tab.dashboard
func tabbarItem(text: String, image: String) -> some View {
VStack {
Image(image)
Text(text)
}
}
var body: some View {
TabView(selection: $selectedTab) {
Group {
HomeView().tabItem{
self.tabbarItem(text: "Home", image: "icon-bells")
}.tag(UIState.Tab.items)
}
}.accentColor(.white)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment