43 lines
1.0 KiB
Swift
43 lines
1.0 KiB
Swift
//
|
|
// FitnessTabView.swift
|
|
// FitnessApp
|
|
//
|
|
// Created by Matt Bruce on 12/20/24.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct FitnessTabView: View {
|
|
@State var selectedTab = "Home"
|
|
|
|
init() {
|
|
let appearace = UITabBarAppearance()
|
|
appearace.configureWithOpaqueBackground()
|
|
appearace.stackedLayoutAppearance.selected.iconColor = .green
|
|
appearace.stackedLayoutAppearance.selected.titleTextAttributes =
|
|
[.foregroundColor: UIColor.label]
|
|
UITabBar.appearance().scrollEdgeAppearance = appearace
|
|
}
|
|
|
|
var body: some View {
|
|
TabView(selection: $selectedTab) {
|
|
HomeView()
|
|
.tag("Home")
|
|
.tabItem {
|
|
Image(systemName: "house")
|
|
Text("Home")
|
|
}
|
|
HistoricDataView()
|
|
.tag("Historic")
|
|
.tabItem {
|
|
Image(systemName: "chart.line.uptrend.xyaxis")
|
|
Text("Historic")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
FitnessTabView()
|
|
}
|