Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

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

Rev 11 Rev 14
Línea 9... Línea 9...
9
 
9
 
Línea 10... Línea -...
10
struct CardSlideView: View {
-
 
-
 
10
struct CardSlideView: View {
Línea -... Línea 11...
-
 
11
    
-
 
12
    
11
    
13
    
12
    
14
   
Línea 13... Línea 15...
13
    
15
 
14
    private let appDao = AppDao.sharedInstance
-
 
-
 
16
 
Línea 15... Línea 17...
15
 
17
    private let userUuid : String
16
    private var position : Int
18
    private let positionInitial : Int
-
 
19
    private var viewModel = SlideCardViewModel()
17
    private var viewModel = SlideCardViewModel()
20
    
-
 
21
    @EnvironmentObject private var appNavigation : AppNavigation
18
    
22
 
19
    @EnvironmentObject private var appNavigation : AppNavigation
23
    
-
 
24
    init(slideUuid : String, position : Int)
-
 
25
    {
-
 
26
        let appDao = AppDao.sharedInstance
Línea 20... Línea 27...
20
    @State private var goToGallery : Bool = false
27
        let appData = appDao.selectOne()
21
    
28
        
22
    init(slideUuid : String, position : Int)
29
        positionInitial = position
Línea 35... Línea 42...
35
    
42
    
Línea 36... Línea 43...
36
 
43
 
-
 
44
    var body: some View {
37
    var body: some View {
45
 
38
 
46
        Button(action: {
39
        Button(action: {
47
            let appDao = AppDao.sharedInstance
40
            var appData = appDao.selectOne()
48
            var appData = appDao.selectOne()
41
            appData.topicUuidActive = self.viewModel.slide.topicUuid
49
            appData.topicUuidActive = self.viewModel.slide.topicUuid
Línea 42... Línea 50...
42
            appData.capsuleUuidActive = self.viewModel.slide.capsuleUuid
50
            appData.capsuleUuidActive = self.viewModel.slide.capsuleUuid
43
            appData.slideUuidActive = self.viewModel.slide.uuid
51
            appData.slideUuidActive = self.viewModel.slide.uuid
Línea 44... Línea 52...
44
            appData.slidePositionInitial = self.position
52
            appData.slidePositionInitial = self.positionInitial
Línea 108... Línea 116...
108
                    RoundedRectangle(cornerRadius: 16)
116
                    RoundedRectangle(cornerRadius: 16)
109
                        .stroke(Color("color_card_view_border"), lineWidth: 1)
117
                        .stroke(Color("color_card_view_border"), lineWidth: 1)
110
                )
118
                )
111
                .padding(.horizontal, 5)
119
                .padding(.horizontal, 5)
112
            }
120
            }
-
 
121
            .onAppear {
-
 
122
                self.viewModel.fetchProgress(slideUuid: self.viewModel.slide.uuid, userUuid: self.userUuid)
-
 
123
            }
-
 
124
            /*
113
            .onReceive(NotificationCenter.default.publisher(for: Constants.NOTIFICATION_NAME_COMPLETED_SLIDE))
125
            .onReceive(NotificationCenter.default.publisher(for: Constants.NOTIFICATION_NAME_COMPLETED_SLIDE))
114
            { data in
126
            { data in
115
                let appData = appDao.selectOne()
127
                let appData = appDao.selectOne()
116
                if data.userInfo != nil {
128
                if data.userInfo != nil {
117
                    if let notificationSlideUuid = data.userInfo?["slideUuid"]! as? String {
129
                    if let notificationSlideUuid = data.userInfo?["slideUuid"]! as? String {
118
                        if !notificationSlideUuid.isEmpty && notificationSlideUuid == self.viewModel.slide.uuid {
130
                        if !notificationSlideUuid.isEmpty && notificationSlideUuid == self.viewModel.slide.uuid {
119
                            self.viewModel.fetchProgress(slideUuid: notificationSlideUuid, userUuid: appData.userUuid)
131
                            self.viewModel.fetchProgress(slideUuid: notificationSlideUuid, userUuid: appData.userUuid)
120
                        }
132
                        }
121
                    }
133
                    }
122
                }
134
                }
123
            }
135
            }*/
Línea 124... Línea 136...
124
           
136
           
125
        } .padding(.top, 5)
137
        } .padding(.top, 5)
Línea 126... Línea 138...
126
    }
138
    }