Skip to content

Commit

Permalink
FIX: Bug fixes to get app to run.
Browse files Browse the repository at this point in the history
Signed-off-by: ParsaKargari <[email protected]>
  • Loading branch information
ParsaKargari committed Apr 3, 2024
1 parent 66d0289 commit 7a235ef
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 20 deletions.
Binary file modified Rethread/.DS_Store
Binary file not shown.
20 changes: 8 additions & 12 deletions Rethread/Rethread.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@
7C62399C2BB20D3600B4E2BF /* GenBottomsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C62399B2BB20D3600B4E2BF /* GenBottomsView.swift */; };
7C62399E2BB20D3F00B4E2BF /* GenShoesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C62399D2BB20D3F00B4E2BF /* GenShoesView.swift */; };
7C6748AB2B8D34E300F32B94 /* aboutArc'teryxBrandView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C6748AA2B8D34E300F32B94 /* aboutArc'teryxBrandView.swift */; };
7C7F21C42B9110B9003AF034 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7C7F21C32B9110B9003AF034 /* GoogleService-Info.plist */; };
7C83052A2BA3722A00FFD298 /* ReelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8305282BA3722A00FFD298 /* ReelView.swift */; };
7C83052B2BA3722A00FFD298 /* VideoPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8305292BA3722A00FFD298 /* VideoPlayer.swift */; };
7C83052E2BA3725B00FFD298 /* ReelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C83052C2BA3725B00FFD298 /* ReelModel.swift */; };
7C83052F2BA3725B00FFD298 /* MediaModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C83052D2BA3725B00FFD298 /* MediaModel.swift */; };
7C8305312BA3727800FFD298 /* FullVidView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8305302BA3727800FFD298 /* FullVidView.swift */; };
7C8305362BA374FC00FFD298 /* Reel5.MP4 in Resources */ = {isa = PBXBuildFile; fileRef = 7C8305322BA374FB00FFD298 /* Reel5.MP4 */; };
7C8305372BA374FC00FFD298 /* Reel4.MP4 in Resources */ = {isa = PBXBuildFile; fileRef = 7C8305332BA374FB00FFD298 /* Reel4.MP4 */; };
7C8305382BA374FC00FFD298 /* Reel3.MP4 in Resources */ = {isa = PBXBuildFile; fileRef = 7C8305342BA374FC00FFD298 /* Reel3.MP4 */; };
7C8305392BA374FC00FFD298 /* Reel2.mov in Resources */ = {isa = PBXBuildFile; fileRef = 7C8305352BA374FC00FFD298 /* Reel2.mov */; };
Expand All @@ -29,14 +26,15 @@
7CF454AB2B8697B200DB3105 /* ScannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF454AA2B8697B200DB3105 /* ScannerView.swift */; };
7CF454AD2B87DCF400DB3105 /* aboutPatagoniaBrandView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF454AC2B87DCF400DB3105 /* aboutPatagoniaBrandView.swift */; };
7CF454AF2B87EBE600DB3105 /* FilterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF454AE2B87EBE600DB3105 /* FilterModel.swift */; };
9807FC562BBD143900A2D727 /* FullVidView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9807FC552BBD143900A2D727 /* FullVidView.swift */; };
9807FC582BBD147B00A2D727 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9807FC572BBD147B00A2D727 /* GoogleService-Info.plist */; };
983014C22B451A3E004A6A07 /* NavigationTransitions in Frameworks */ = {isa = PBXBuildFile; productRef = 983014C12B451A3E004A6A07 /* NavigationTransitions */; };
983286B92B05698F00851B19 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 983286B82B05698F00851B19 /* Assets.xcassets */; };
983286BC2B05698F00851B19 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 983286BB2B05698F00851B19 /* Preview Assets.xcassets */; };
983286C62B05698F00851B19 /* RethreadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 983286C52B05698F00851B19 /* RethreadTests.swift */; };
983286D02B05698F00851B19 /* RethreadUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 983286CF2B05698F00851B19 /* RethreadUITests.swift */; };
983286D22B05698F00851B19 /* RethreadUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 983286D12B05698F00851B19 /* RethreadUITestsLaunchTests.swift */; };
98434A5D2B63342700F81127 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98434A5C2B63342700F81127 /* ContentView.swift */; };
98547AB62BA79B060098C9C2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 98547AB52BA79B060098C9C2 /* GoogleService-Info.plist */; };
985674F12B663E0D003FA5A0 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 985674F02B663E0D003FA5A0 /* FirebaseAuth */; };
985674F32B663E0D003FA5A0 /* FirebaseFirestore in Frameworks */ = {isa = PBXBuildFile; productRef = 985674F22B663E0D003FA5A0 /* FirebaseFirestore */; };
985674F52B663E0D003FA5A0 /* FirebaseFirestoreSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 985674F42B663E0D003FA5A0 /* FirebaseFirestoreSwift */; };
Expand Down Expand Up @@ -92,12 +90,10 @@
7C62399B2BB20D3600B4E2BF /* GenBottomsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenBottomsView.swift; sourceTree = "<group>"; };
7C62399D2BB20D3F00B4E2BF /* GenShoesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenShoesView.swift; sourceTree = "<group>"; };
7C6748AA2B8D34E300F32B94 /* aboutArc'teryxBrandView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "aboutArc'teryxBrandView.swift"; sourceTree = "<group>"; };
7C7F21C32B9110B9003AF034 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
7C8305282BA3722A00FFD298 /* ReelView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReelView.swift; sourceTree = "<group>"; };
7C8305292BA3722A00FFD298 /* VideoPlayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPlayer.swift; sourceTree = "<group>"; };
7C83052C2BA3725B00FFD298 /* ReelModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReelModel.swift; sourceTree = "<group>"; };
7C83052D2BA3725B00FFD298 /* MediaModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaModel.swift; sourceTree = "<group>"; };
7C8305302BA3727800FFD298 /* FullVidView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FullVidView.swift; path = "../../../../../../VideoApp-main/InstReels/View/FullVidView.swift"; sourceTree = "<group>"; };
7C8305322BA374FB00FFD298 /* Reel5.MP4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = Reel5.MP4; sourceTree = "<group>"; };
7C8305332BA374FB00FFD298 /* Reel4.MP4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = Reel4.MP4; sourceTree = "<group>"; };
7C8305342BA374FC00FFD298 /* Reel3.MP4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = Reel3.MP4; sourceTree = "<group>"; };
Expand All @@ -111,6 +107,8 @@
7CF454AA2B8697B200DB3105 /* ScannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannerView.swift; sourceTree = "<group>"; };
7CF454AC2B87DCF400DB3105 /* aboutPatagoniaBrandView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = aboutPatagoniaBrandView.swift; sourceTree = "<group>"; };
7CF454AE2B87EBE600DB3105 /* FilterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterModel.swift; sourceTree = "<group>"; };
9807FC552BBD143900A2D727 /* FullVidView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullVidView.swift; sourceTree = "<group>"; };
9807FC572BBD147B00A2D727 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
983286B12B05698E00851B19 /* Rethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Rethread.app; sourceTree = BUILT_PRODUCTS_DIR; };
983286B82B05698F00851B19 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
983286BB2B05698F00851B19 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
Expand All @@ -122,7 +120,6 @@
983D40FA2B68D13E00905D4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
98434A5C2B63342700F81127 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
98547AB42BA799900098C9C2 /* Rethread.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Rethread.entitlements; sourceTree = "<group>"; };
98547AB52BA79B060098C9C2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
9868A7DD2B1FAE780063D9BA /* ButtonStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonStyles.swift; sourceTree = "<group>"; };
988A0F982B3C112300ACDC90 /* DatePickerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatePickerModel.swift; sourceTree = "<group>"; };
9897C7722B3E6C4000EDE9D9 /* CustomDropdownMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomDropdownMenu.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -234,7 +231,7 @@
983286B32B05698E00851B19 /* Rethread */ = {
isa = PBXGroup;
children = (
98547AB52BA79B060098C9C2 /* GoogleService-Info.plist */,
9807FC572BBD147B00A2D727 /* GoogleService-Info.plist */,
98547AB42BA799900098C9C2 /* Rethread.entitlements */,
983D40FA2B68D13E00905D4E /* Info.plist */,
7C9AA2D42B0ECADF00EF6F36 /* Styles */,
Expand Down Expand Up @@ -303,7 +300,6 @@
98BBA10D2B68A6A100003AC2 /* Views */ = {
isa = PBXGroup;
children = (
7C8305302BA3727800FFD298 /* FullVidView.swift */,
7C8305282BA3722A00FFD298 /* ReelView.swift */,
7C8305292BA3722A00FFD298 /* VideoPlayer.swift */,
98BBA10F2B68A6A100003AC2 /* ProfileView.swift */,
Expand All @@ -327,6 +323,7 @@
98BBA11A2B68A6A100003AC2 /* SignUpView.swift */,
98BBA11B2B68A6A100003AC2 /* OnboardingView.swift */,
7CF454AA2B8697B200DB3105 /* ScannerView.swift */,
9807FC552BBD143900A2D727 /* FullVidView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -478,11 +475,10 @@
files = (
7C8305392BA374FC00FFD298 /* Reel2.mov in Resources */,
983286BC2B05698F00851B19 /* Preview Assets.xcassets in Resources */,
98547AB62BA79B060098C9C2 /* GoogleService-Info.plist in Resources */,
983286B92B05698F00851B19 /* Assets.xcassets in Resources */,
7C8305372BA374FC00FFD298 /* Reel4.MP4 in Resources */,
7C7F21C42B9110B9003AF034 /* GoogleService-Info.plist in Resources */,
7C8305382BA374FC00FFD298 /* Reel3.MP4 in Resources */,
9807FC582BBD147B00A2D727 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -512,7 +508,6 @@
9868A7DE2B1FAE780063D9BA /* ButtonStyles.swift in Sources */,
7CF454AF2B87EBE600DB3105 /* FilterModel.swift in Sources */,
98EA47352B6065C600AA2E8F /* User.swift in Sources */,
7C8305312BA3727800FFD298 /* FullVidView.swift in Sources */,
98BBA12D2B68ACBF00003AC2 /* Verification.swift in Sources */,
7CF454A92B86948C00DB3105 /* PhotoPickerModel.swift in Sources */,
98A1838C2B38D32A001E324A /* ColorPalette.swift in Sources */,
Expand All @@ -539,6 +534,7 @@
9897C7732B3E6C4000EDE9D9 /* CustomDropdownMenu.swift in Sources */,
98BBA1272B68A6A100003AC2 /* AuthenticationView.swift in Sources */,
98BBA1212B68A6A100003AC2 /* MainView.swift in Sources */,
9807FC562BBD143900A2D727 /* FullVidView.swift in Sources */,
7C83052E2BA3725B00FFD298 /* ReelModel.swift in Sources */,
98BBA1252B68A6A100003AC2 /* SwiftUIView.swift in Sources */,
7C3B47132B853E520068DCCE /* AccountSettingsView.swift in Sources */,
Expand Down
Binary file modified Rethread/Rethread/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Rethread/Rethread/Core/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct ContentView: View {
} else if viewModel.currentUser?.onboardingComplete == false {
WelcomeView()
} else if viewModel.userSession != nil {
MainView()
MainView().environmentObject(self.viewModel)
} else {
AuthenticationView()
}
Expand Down
6 changes: 3 additions & 3 deletions Rethread/Rethread/Core/OnboardingApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ struct OnboardingApp: App {

var body: some Scene {
WindowGroup {
// ContentView()
// .environmentObject(viewModel)
MainView()
ContentView()
.environmentObject(viewModel)
// MainView().environmentObject(viewModel)
}
}
}
82 changes: 82 additions & 0 deletions Rethread/Rethread/Views/FullVidView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
//
// MainView.swift
// InstReels
//
//

import SwiftUI

struct FullVidView: View {

init() {
UITabBar.appearance().isHidden = true
}

@State var currentTab = "Reel"

enum Tab: String, CaseIterable {
case search = "Search", reel = "Reel", home = "Home"

var image: String {
switch self {
case .home: "house.fill"
case .search: "magnifyingglass"
case .reel: "play.rectangle"
}
}
}


var body: some View {
VStack(spacing: 0) {
TabView(selection: $currentTab) {
ForEach(Tab.allCases, id: \.self) { tab in

if tab == .reel {
ReelView()
.tag(tab.rawValue)
} else {
Rectangle()
.fill(Color(uiColor: .systemGray6))
.frame(width: 300, height: 500)
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay {
Text(tab.rawValue)
}
.tag(tab.rawValue)
}

}

}

HStack(spacing: 0) {
ForEach(Tab.allCases, id: \.self) { tab in
makeTabBarButton(for: tab)
}
}
}
}

}

extension FullVidView {
private func makeTabBarButton(for tab: Tab) -> some View {
Button {
withAnimation { currentTab = tab.rawValue }
} label: {
Image(systemName: tab.image)
.resizable()
.renderingMode(.template)
.foregroundStyle(.gray)
.aspectRatio(contentMode: .fit)
.frame(width: 26, height: 26)
.padding(.top, 16)
.frame(maxWidth: .infinity)
}
}
}

#Preview {
FullVidView()
}
4 changes: 3 additions & 1 deletion Rethread/Rethread/Views/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PhotosUI

struct HomeView: View {




var body: some View {
Expand Down Expand Up @@ -43,6 +43,8 @@ struct HomeView: View {


struct MainView: View {

@EnvironmentObject var viewModel: AuthViewModel

@State private var isTabBarHidden: Bool = false
@State var selectedTab: Int = 100
Expand Down
3 changes: 1 addition & 2 deletions Rethread/Rethread/Views/SignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ struct SignInView: View {
Task {
try await viewModel.sendVerificationCode(phoneNumber: phoneNumber) { success, error in
if success {
isShowingVerification.toggle()
self.isShowingVerification = true
} else {
print("DEBUG: Error sending verification code: \(error?.localizedDescription ?? "Unknown error")")
}
}
}
self.isShowingVerification = true
} else {
// No phone number found, handle accordingly
print("No phone number associated with this account.")
Expand Down
2 changes: 1 addition & 1 deletion Rethread/Rethread/Views/VerificationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ struct VerificationView: View {
try await viewModel.verifyPhoneNumber(verificationCode: otpCode)
try await viewModel.signIn(withEmail: signInData.email, password: signInData.password)
isLoading = false
dismiss()
} catch {
isLoading = false
print("DEBUG: Error logging user in : \(error.localizedDescription)")
}
}
Expand Down

0 comments on commit 7a235ef

Please sign in to comment.