Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import SwiftUI
- struct MainView: View {
- //let possibleBackgroundColor = RadialGradient(colors: [Color(#colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1)), Color.black], center: .top, startRadius: 5, endRadius: UIScreen.main.bounds.height).ignoresSafeArea()
- @State private var selection: Int = 1
- var body: some View {
- TabView(selection: $selection) {
- HomeView()
- .tabItem {
- Image(systemName: "house.fill")
- Text("Home")
- }
- .tag(0)
- PlanView()
- .tabItem {
- Image(systemName: "stopwatch")
- Text("Workout")
- }
- .tag(1)
- ProfileView()
- .tabItem {
- Image(systemName: "person.fill")
- Text("Profile")
- }
- .tag(2)
- }
- .accentColor(.red)
- }
- }
- struct MainView_Previews: PreviewProvider {
- static var previews: some View {
- MainView()
- }
- }
- struct HomeView: View {
- var body: some View {
- ZStack {
- Text("HOME")
- }
- }
- }
- struct PlanView: View {
- let workouts = workoutsData
- var body: some View {
- VStack(alignment: .leading) {
- HStack {
- Text("My Workouts")
- .font(.title)
- .fontWeight(.semibold)
- .padding()
- Spacer()
- }
- ScrollView(.horizontal, showsIndicators: false) {
- HStack(spacing: 20) {
- ForEach(workouts) { card in
- MyWorkoutsCards()
- }
- }
- }
- .offset(x: 0, y: -25)
- .padding()
- HStack {
- Text("Discover")
- .font(.largeTitle)
- .fontWeight(.semibold)
- .padding()
- }
- HStack(spacing: 20) {
- ZStack {
- PersonalizedCard()
- .onTapGesture {
- /* Personalized Screen
- CHECK FOR SUBSCRIPTION
- */
- }
- }
- }
- .padding()
- }
- }
- }
- struct ProfileView: View {
- var body: some View {
- Text("Profile View")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment