-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOldContentView.swift
72 lines (72 loc) · 2.36 KB
/
OldContentView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
////
//// ContentView.swift
//// navigation
////
//// Created by Emily Markova on 7/28/23.
////
//
//import SwiftUI
//
//struct ContentView: View {
// @StateObject var viewModel = ContentViewViewModel()
// @StateObject var timerModel = TimerViewViewModel()
// @StateObject var profileViewModel = ProfileViewViewModel(userName: "")
//
// @Environment(\.scenePhase) var phase
//
// @State var lastActiveTimeStamp: Date = Date()
// var body: some View {
// if viewModel.isSignedIn, !viewModel.currentUserId.isEmpty {
// accountView
// .environmentObject(viewModel)
// .environmentObject(timerModel)
// } else {
// LoginView()
// }
// }
// @ViewBuilder
// var accountView: some View {
// TabView {
// ToDoListView(userId: viewModel.currentUserId)
// .tabItem{
// Label("Home", systemImage:"house")
// }
// ProfileView(viewModel: profileViewModel)
// .tabItem{
// Label("Profile", systemImage:"person.circle")
// }
// StudyView()
// .tabItem{
// Label("Study", systemImage: "clock")
// }
// .onChange(of: phase) { newValue in
// if newValue == .background{
// lastActiveTimeStamp = Date()
// }
// if newValue == .active {
// //finding the difference
// let currentTimeStampDiff = Date().timeIntervalSince(lastActiveTimeStamp)
// if timerModel.totalSeconds - Int(currentTimeStampDiff) <= 0{
// timerModel.isStarted = false
// timerModel.totalSeconds = 0
// timerModel.isFinished = true
// } else {
// timerModel.totalSeconds -= Int(currentTimeStampDiff)
// }
// }
// }
// SearchView()
// .tabItem{
// Label("Search", systemImage: "magnifyingglass.circle.fill")
// }
//
// }
// }
//}
//
//
//struct ContentView_Previews: PreviewProvider {
// static var previews: some View {
// ContentView()
// }
//}