From 4bc2306aebb5141c9cafd887c767acdd88a9f7d3 Mon Sep 17 00:00:00 2001 From: joshua kilaha Date: Sun, 20 Nov 2022 00:25:45 +0300 Subject: [PATCH 1/7] Spacer bottom Text --- BuildTinder/Home/CardViews/CardImageScroller.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BuildTinder/Home/CardViews/CardImageScroller.swift b/BuildTinder/Home/CardViews/CardImageScroller.swift index 4f75e12..202678b 100644 --- a/BuildTinder/Home/CardViews/CardImageScroller.swift +++ b/BuildTinder/Home/CardViews/CardImageScroller.swift @@ -119,6 +119,8 @@ struct CardImageScroller: View { }) } .padding(16) + // space for horizontal Tab + .padding(.bottom, 60) } } .foregroundColor(Color.white) From 57d248ed32af43c14d16f964d6dda9d43669b55a Mon Sep 17 00:00:00 2001 From: joshua kilaha Date: Sun, 20 Nov 2022 00:29:29 +0300 Subject: [PATCH 2/7] CardView 100% of the screen --- BuildTinder/Home/CardViews/CardStack.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/BuildTinder/Home/CardViews/CardStack.swift b/BuildTinder/Home/CardViews/CardStack.swift index 412880b..4dd8fa5 100644 --- a/BuildTinder/Home/CardViews/CardStack.swift +++ b/BuildTinder/Home/CardViews/CardStack.swift @@ -16,13 +16,15 @@ struct CardStack: View { var screen = UIScreen.main.bounds var body: some View { - - ZStack { - ForEach(people) { person in - CardView(person: person, fullScreenMode: $fullScreenMode) + GeometryReader { geo in + ZStack { + ForEach(people) { person in + CardView(person: person, fullScreenMode: $fullScreenMode) + } } + // Height to 100% of the screen + .frame(width: screen.width, height: fullScreenMode ? screen.height : geo.size.height * 1.0) } - .frame(width: screen.width, height: fullScreenMode ? screen.height : 550) } } From feec781fbd727a37d8b7e82cee1f3284a3fb5cfe Mon Sep 17 00:00:00 2001 From: joshua kilaha Date: Sun, 20 Nov 2022 00:30:49 +0300 Subject: [PATCH 3/7] Circle Horizontal Tab offset to -2 --- BuildTinder/Home/HomeView.swift | 92 ++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/BuildTinder/Home/HomeView.swift b/BuildTinder/Home/HomeView.swift index c4b9e4a..a337def 100644 --- a/BuildTinder/Home/HomeView.swift +++ b/BuildTinder/Home/HomeView.swift @@ -15,50 +15,12 @@ struct HomeView: View { var body: some View { VStack{ - CardStack(people: userMng.cardPeople) - - Spacer() - - HStack{ - CircleButtonView(type: .back) { - appState.showPurchaseScreen() - } - Spacer() - - CircleButtonView(type: .no) { - if let person = userMng.cardPeople.last { - userMng.swipe(person, .nope) - } - } - Spacer() - - CircleButtonView(type: .star) { - if let person = userMng.cardPeople.last { - if userMng.currentUser.goldSubscriber { - userMng.superLike(person) - } else { - appState.showPurchaseScreen() - } - } - } - Spacer() - - CircleButtonView(type: .heart) { - if let person = userMng.cardPeople.last { - userMng.swipe(person, .like) - } - } - Spacer() - - CircleButtonView(type: .lightning) { - appState.showPurchaseScreen() - } + GeometryReader { geo in + CardStack(people: userMng.cardPeople) + .frame(height: geo.size.height * 1.15) } - .frame(height: 50) - .padding(.horizontal) - .padding(.vertical, 25) - - Spacer() + CircleHorizontalTab + .offset(y: -2) } } } @@ -70,3 +32,47 @@ struct HomeView_Previews: PreviewProvider { .environmentObject(AppStateManager()) } } + +private extension HomeView { + // Circle button View + var CircleHorizontalTab: some View { + HStack { + CircleButtonView(type: .back) { + appState.showPurchaseScreen() + } + Spacer() + + CircleButtonView(type: .no) { + if let person = userMng.cardPeople.last { + userMng.swipe(person, .nope) + } + } + Spacer() + + CircleButtonView(type: .star) { + if let person = userMng.cardPeople.last { + if userMng.currentUser.goldSubscriber { + userMng.superLike(person) + } else { + appState.showPurchaseScreen() + } + } + } + Spacer() + + CircleButtonView(type: .heart) { + if let person = userMng.cardPeople.last { + userMng.swipe(person, .like) + } + } + Spacer() + + CircleButtonView(type: .lightning) { + appState.showPurchaseScreen() + } + } + .frame(height: 50) + .padding(.horizontal) + .padding(.vertical, 25) + } +} From ead44728d03278f33a9f03f1c72721b9ccbf8411 Mon Sep 17 00:00:00 2001 From: joshua kilaha Date: Sun, 20 Nov 2022 00:31:37 +0300 Subject: [PATCH 4/7] TabView Init --- BuildTinder/MainTabBar/MainView.swift | 167 +++++++++++++++++--------- 1 file changed, 107 insertions(+), 60 deletions(-) diff --git a/BuildTinder/MainTabBar/MainView.swift b/BuildTinder/MainTabBar/MainView.swift index 9ace2f9..49df27e 100644 --- a/BuildTinder/MainTabBar/MainView.swift +++ b/BuildTinder/MainTabBar/MainView.swift @@ -7,75 +7,39 @@ import SwiftUI - - struct MainView: View { - @EnvironmentObject var appState: AppStateManager - - func correctViewForState() -> some View{ - switch appState.selectedTab { - - case .fire: - let view = HomeView() - return AnyView(view) - case .star: - let view = MatchesView() - return AnyView(view) - case .message: - let view = MessageListView() - return AnyView(view) - case .profile: - let view = ProfileView() - return AnyView(view) - } - } var body: some View { - NavigationView { - ZStack{ - Color(.systemGray6) - .opacity(0.35) - .edgesIgnoringSafeArea(.vertical) - VStack{ - HStack { - Spacer() - - TabBarButtonView(type: .fire) - - Spacer() - - TabBarButtonView(type: .star) - - Spacer() - - TabBarButtonView(type: .message) - - Spacer() - - TabBarButtonView(type: .profile) - - Spacer() + NavigationView { + // Bottom tab view + TabView { + HomeView() + .tabItem { + Image(systemName: "flame.fill") + } + MatchesView() + .tabItem { + Image(systemName: "star.fill") + } + MessageListView() + .tabItem { + Image(systemName: "message.fill") + } + ProfileView() + .tabItem { + Image(systemName: "person.fill") } - .frame( height: 100) - .padding(.top, 30) - correctViewForState() - - Spacer() - } - .edgesIgnoringSafeArea(.vertical) - - if appState.showPurchasePopup { - PurchasePopup(isVisible: $appState.showPurchasePopup) - .animation(.spring(response: 0.3, dampingFraction: 0.75, blendDuration: 0.5)) - .transition(.offset(y: 800)) - } } - .modifier(HideNavigationView()) + if appState.showPurchasePopup { + PurchasePopup(isVisible: $appState.showPurchasePopup) + .animation(.spring(response: 0.3, dampingFraction: 0.75, blendDuration: 0.5)) + .transition(.offset(y: 800)) + } } - } } + struct MainView_Previews: PreviewProvider { static var previews: some View { MainView() @@ -83,3 +47,86 @@ struct MainView_Previews: PreviewProvider { .environmentObject(UserManager()) } } + +//struct MainView: View { +// +// @EnvironmentObject var appState: AppStateManager +// +// func correctViewForState() -> some View{ +// switch appState.selectedTab { +// +// case .fire: +// let view = HomeView() +// return AnyView(view) +// case .star: +// let view = MatchesView() +// return AnyView(view) +// case .message: +// let view = MessageListView() +// return AnyView(view) +// case .profile: +// let view = ProfileView() +// return AnyView(view) +// } +// } +// var body: some View { +// NavigationView { +// ZStack{ +// Color(.systemGray6) +// .opacity(0.35) +// .edgesIgnoringSafeArea(.vertical) +// VStack{ +// HStack { +// Spacer() +// +// TabBarButtonView(type: .fire) +// +// Spacer() +// +// TabBarButtonView(type: .star) +// +// Spacer() +// +// TabBarButtonView(type: .message) +// +// Spacer() +// +// TabBarButtonView(type: .profile) +// +// Spacer() +// } +// .frame( height: 100) +// .padding(.top, 30) +// correctViewForState() +// +// Spacer() +// } +// .edgesIgnoringSafeArea(.vertical) +// +// if appState.showPurchasePopup { +// PurchasePopup(isVisible: $appState.showPurchasePopup) +// .animation(.spring(response: 0.3, dampingFraction: 0.75, blendDuration: 0.5)) +// .transition(.offset(y: 800)) +// } +// } +// .modifier(HideNavigationView()) +// } +// +// } +//} +// +//struct MainView_Previews: PreviewProvider { +// static var previews: some View { +// MainView() +// .environmentObject(AppStateManager()) +// .environmentObject(UserManager()) +// } +//} +// +//private extension MainView { +//// var tabview: some View { +//// +//// } +// +// +//} From 3542330fe1902b6959feeb679d4738229bba1c9c Mon Sep 17 00:00:00 2001 From: joshua kilaha Date: Sun, 20 Nov 2022 12:10:47 +0300 Subject: [PATCH 5/7] ZStack for app State --- BuildTinder.xcodeproj/project.pbxproj | 2 ++ BuildTinder/MainTabBar/MainView.swift | 48 ++++++++++++++------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/BuildTinder.xcodeproj/project.pbxproj b/BuildTinder.xcodeproj/project.pbxproj index 23cdd18..d0163e7 100644 --- a/BuildTinder.xcodeproj/project.pbxproj +++ b/BuildTinder.xcodeproj/project.pbxproj @@ -495,6 +495,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"BuildTinder/Preview Content\""; + DEVELOPMENT_TEAM = 5Z3UL2PDB7; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -523,6 +524,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"BuildTinder/Preview Content\""; + DEVELOPMENT_TEAM = 5Z3UL2PDB7; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; diff --git a/BuildTinder/MainTabBar/MainView.swift b/BuildTinder/MainTabBar/MainView.swift index 49df27e..ddd9c1e 100644 --- a/BuildTinder/MainTabBar/MainView.swift +++ b/BuildTinder/MainTabBar/MainView.swift @@ -11,29 +11,31 @@ struct MainView: View { @EnvironmentObject var appState: AppStateManager var body: some View { NavigationView { - // Bottom tab view - TabView { - HomeView() - .tabItem { - Image(systemName: "flame.fill") - } - MatchesView() - .tabItem { - Image(systemName: "star.fill") - } - MessageListView() - .tabItem { - Image(systemName: "message.fill") - } - ProfileView() - .tabItem { - Image(systemName: "person.fill") - } - } - if appState.showPurchasePopup { - PurchasePopup(isVisible: $appState.showPurchasePopup) - .animation(.spring(response: 0.3, dampingFraction: 0.75, blendDuration: 0.5)) - .transition(.offset(y: 800)) + // Bottom tab view + ZStack { + TabView { + HomeView() + .tabItem { + Image(systemName: "flame.fill") + } + MatchesView() + .tabItem { + Image(systemName: "star.fill") + } + MessageListView() + .tabItem { + Image(systemName: "message.fill") + } + ProfileView() + .tabItem { + Image(systemName: "person.fill") + } + } + if appState.showPurchasePopup { + PurchasePopup(isVisible: $appState.showPurchasePopup) + .animation(.spring(response: 0.3, dampingFraction: 0.75, blendDuration: 0.5)) + .transition(.offset(y: 800)) + } } } } From 6788d7707056ba1fb9ef0c6b7b196c87d28d38cb Mon Sep 17 00:00:00 2001 From: joshua kilaha Date: Sat, 10 Dec 2022 08:57:31 +0300 Subject: [PATCH 6/7] Center Image padding to 85 --- BuildTinder/Home/CardViews/CardImageScroller.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildTinder/Home/CardViews/CardImageScroller.swift b/BuildTinder/Home/CardViews/CardImageScroller.swift index 202678b..a1d4afe 100644 --- a/BuildTinder/Home/CardViews/CardImageScroller.swift +++ b/BuildTinder/Home/CardViews/CardImageScroller.swift @@ -120,7 +120,7 @@ struct CardImageScroller: View { } .padding(16) // space for horizontal Tab - .padding(.bottom, 60) + .padding(.bottom, 85) } } .foregroundColor(Color.white) From aedb1a9285746d81952fb27d4d03b05dfdb3b4ff Mon Sep 17 00:00:00 2001 From: joshua kilaha Date: Sat, 10 Dec 2022 08:57:56 +0300 Subject: [PATCH 7/7] CardStack offset -6.5 --- BuildTinder/Home/HomeView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildTinder/Home/HomeView.swift b/BuildTinder/Home/HomeView.swift index a337def..5e0215b 100644 --- a/BuildTinder/Home/HomeView.swift +++ b/BuildTinder/Home/HomeView.swift @@ -20,7 +20,7 @@ struct HomeView: View { .frame(height: geo.size.height * 1.15) } CircleHorizontalTab - .offset(y: -2) + .offset(y: -6.5) } } }