Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 17 | Rev 23 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 17 Rev 21
Línea 75... Línea 75...
75
        VStack(spacing: 0) {
75
        VStack(spacing: 0) {
Línea 76... Línea 76...
76
            
76
            
77
            
77
            
78
            HStack {
-
 
79
                Button(action: {
-
 
80
                    if self.url != nil {
-
 
81
                        do {
-
 
82
                            try FileManager.default.removeItem(at: self.url!)
-
 
83
                                   print("Video temporal borrado")
-
 
84
                         } catch {
-
 
85
                            print(error)
-
 
86
                        }
-
 
87
                    }
-
 
88
                    
-
 
89
                    let dataService = DataService()
-
 
90
                    if self.isCompleted {
78
            HStack {
91
                        dataService.completeSlide(slide: slideModel)
-
 
92
                    } else {
-
 
93
                        dataService.incompleteSlide(slide: slideModel)
-
 
94
                    }
-
 
95
                    
-
 
96
                    if self.timerActive {
-
 
97
                        self.timer.upstream.connect().cancel()
-
 
98
                    }
-
 
99
                    
-
 
100
                    AppDelegate.orientationLock = UIInterfaceOrientationMask.portrait
-
 
101
                    UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
-
 
102
                    UIViewController.attemptRotationToDeviceOrientation()
-
 
103
                    
-
 
104
 
-
 
105
                    appNavigation.pageActive = .home
-
 
106
                    
-
 
107
                    
79
                Button(action: {
108
               
-
 
109
                }, label: {
-
 
110
 
80
                    backToGallery()
111
                    
81
                }, label: {
112
                    Image(systemName: "chevron.backward")
82
                    Image(systemName: "chevron.backward")
113
                    .frame(width: 32, height: 32, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
83
                    .frame(width: 32, height: 32, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
114
                    .aspectRatio(contentMode: .fit)
84
                    .aspectRatio(contentMode: .fit)
Línea 148... Línea 118...
148
                                   
118
                                   
149
                            if diference < 10 {
119
                            if diference < 10 {
150
                                self.isCompleted = true;
120
                                self.isCompleted = true;
151
                                self.timer.upstream.connect().cancel()
121
                                self.timer.upstream.connect().cancel()
-
 
122
                                timerActive = false
-
 
123
                                
152
                                timerActive = false
124
                                backToGallery()
153
                            }
125
                            }
154
                        }
126
                        }
155
                    })
127
                    })
156
            }
128
            }
157
        }
129
        }
Línea -... Línea 130...
-
 
130
    }
-
 
131
    
-
 
132
    private func backToGallery()
-
 
133
    {
-
 
134
        if self.url != nil {
-
 
135
            do {
-
 
136
                try FileManager.default.removeItem(at: self.url!)
-
 
137
                       print("Video temporal borrado")
-
 
138
             } catch {
-
 
139
                print(error)
-
 
140
            }
-
 
141
        }
-
 
142
        
-
 
143
        let dataService = DataService()
-
 
144
        if self.isCompleted {
-
 
145
            dataService.completeSlide(slide: slideModel)
-
 
146
        } else {
-
 
147
            dataService.incompleteSlide(slide: slideModel)
-
 
148
        }
-
 
149
        
-
 
150
        if self.timerActive {
-
 
151
            self.timer.upstream.connect().cancel()
-
 
152
        }
-
 
153
        
-
 
154
        AppDelegate.orientationLock = UIInterfaceOrientationMask.portrait
-
 
155
        UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
-
 
156
        UIViewController.attemptRotationToDeviceOrientation()
-
 
157
        
-
 
158
 
-
 
159
        appNavigation.pageActive = .home
Línea 158... Línea 160...
158
    }
160
    }