Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 1 | Rev 17 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
//
2
//  MainView.swift
3
//  twogetskills
4
//
5
//  Created by Efrain Yanez Recanatini on 2/17/22.
6
//
7
 
8
import SwiftUI
9
 
10
struct MainView: View {
11
    @StateObject private var appNavigation = AppNavigation()
12
    @StateObject private var networkMonitor = NetworkMonitor()
13
    @State private var showToast : Bool = true
14
 
15
 
16
    var body: some View {
17
        ZStack {
18
            Color("color_window_background").ignoresSafeArea(.all)
19
 
20
           VStack(spacing: 0) {
8 efrain 21
                switch appNavigation.pageActive
22
                {
23
                    case AppMainPage.intro1 :
1 efrain 24
                        IntroStep1View()
25
                        .environmentObject(appNavigation)
26
                        .environmentObject(networkMonitor)
27
                        .transition(.scale)
28
 
8 efrain 29
                case AppMainPage.intro2 :
1 efrain 30
                        IntroStep2View()
31
                        .environmentObject(appNavigation)
32
                        .environmentObject(networkMonitor)
33
                        .transition(.scale)
34
 
8 efrain 35
                case AppMainPage.intro3 :
1 efrain 36
                        IntroStep3View()
37
                        .environmentObject(appNavigation)
38
                        .environmentObject(networkMonitor)
39
                        .transition(.scale)
40
 
8 efrain 41
                case  AppMainPage.signin :
1 efrain 42
                        SigninView()
43
                        .environmentObject(appNavigation)
44
                        .environmentObject(networkMonitor)
45
                        .transition(.scale)
46
 
8 efrain 47
                case AppMainPage.splash :
48
                    SplashScreenView()
49
                    .environmentObject(appNavigation)
50
                    .environmentObject(networkMonitor)
51
 
52
                case AppMainPage.goodbye :
53
                    GoodByeView()
54
                    .environmentObject(appNavigation)
55
                    .environmentObject(networkMonitor)
56
 
57
                default :
58
                    HomeView()
59
                    .environmentObject(appNavigation)
60
                    .environmentObject(networkMonitor)
61
                    .transition(.scale)
1 efrain 62
 
8 efrain 63
                }
1 efrain 64
 
65
                    //Spacer()
66
                    /*
67
                    if(self.networkMonitor.status == .disconnected) {
68
                        Text("The popup")
69
                        .frame(width: UIScreen.main.bounds.width, height: 60)
70
                        .background(Color("color_error_background"))
71
                        .foregroundColor(Color("color_error_foreground"))
72
                        .font(.callout)
73
                    }*/
74
            }
75
        }
76
 
77
 
78
 
79
 
80
        /*}
81
        .onAppear {
82
            let snackbar = TTGSnackbar(message: "Two actions !", duration: .forever)
83
 
84
            // Action 1
85
            snackbar.actionText = "Yes"
86
            snackbar.actionTextColor = UIColor.green
87
            snackbar.actionBlock = { (snackbar) in  print("Yes") }
88
 
89
            // Action 2
90
            snackbar.secondActionText = "No"
91
            snackbar.secondActionTextColor = UIColor.yellow
92
            snackbar.secondActionBlock = { (snackbar) in  print("No") }
93
 
94
                //{ ((snackbar) in NSLog("Click No !")).dismiss() }
95
 
96
 
97
            snackbar.backgroundColor = colorErrorBackground
98
            snackbar.show()
99
        }
100
 */
101
        /*
102
        .popup(isPresented: self.$networkMonitor.isConnected, type: .toast, position: .bottom, dragToDismiss: false) {
103
 
104
            Text("The popup")
105
            .frame(width: UIScreen.main.bounds.width, height: 60)
106
            .background(Color(colorErrorBackground ?? .red))
107
            .foregroundColor(Color(colorErrorForeground ?? .black))
108
            .font(.callout)
109
        }*/
110
        /*
111
        .toast(isPresenting: $showToast){
112
 
113
                   // `.alert` is the default displayMode
114
                   //AlertToast(type: .regular, title: "Message Sent!")
115
 
116
                   //Choose .hud to toast alert from the top of the screen
117
                   //AlertToast(displayMode: .hud, type: .regular, title: "Message Sent!")
118
 
119
                   //Choose .banner to slide/pop alert from the bottom of the screen
120
                   //AlertToast(displayMode: .banner(.slide), type: .regular, title: "Message Sent!")
121
 
122
 
123
 
124
 
125
 
126
 
127
               }*/
128
 
129
 
130
    }
131
}
132
 
133
struct MainView_Previews: PreviewProvider {
134
    static var previews: some View {
135
        MainView()
136
    }
137
}
138