Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

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

Rev 8 Rev 9
Línea 19... Línea 19...
19
    private let config = [
19
    private let config = [
20
        GridItem(.flexible()),
20
        GridItem(.flexible()),
21
        GridItem(.flexible())
21
        GridItem(.flexible())
22
    ]
22
    ]
Línea 23... Línea 23...
23
    
23
    
24
    private let appData = AppData.sharedInstance
24
    private let appDao = AppDao.sharedInstance
-
 
25
    private var topicTitle : String = ""
Línea 25... Línea 26...
25
    private var topicTitle : String = ""
26
    private let capsuleUuidActive  : String
26
    
27
    
-
 
28
 
-
 
29
    init(preview : Bool = false)
-
 
30
    {
27
 
31
        let appData = appDao.selectOne()
28
    init(preview : Bool = false)
32
        self.capsuleUuidActive  = appData.capsuleUuidActive
Línea 29... Línea 33...
29
    {
33
        
Línea 42... Línea 46...
42
    
46
    
43
    var body: some View {
47
    var body: some View {
44
        VStack(spacing: 0) {
48
        VStack(spacing: 0) {
45
            HStack {
49
            HStack {
46
                Button(action: {
-
 
-
 
50
                Button(action: {
47
                    
51
                    var appData = appDao.selectOne()
48
                    appData.capsuleUuidActive = ""
52
                    appData.capsuleUuidActive = ""
49
                    appData.slideUuidActive = ""
53
                    appData.slideUuidActive = ""
50
                    appData.subPageSource = 0
-
 
51
                    appData.save()
-
 
52
                    
54
                    appDao.update(model: appData)
Línea 53... Línea 55...
53
     
55
 
54
                    
56
                    
55
                    withAnimation {
57
                    withAnimation {
Línea 119... Línea 121...
119
        }
121
        }
Línea 120... Línea 122...
120
 
122
 
121
        .onAppear {
123
        .onAppear {
122
            var i : Int = 0
124
            var i : Int = 0
123
            while i < self.viewModel.capsules.count {
125
            while i < self.viewModel.capsules.count {
124
                if appData.capsuleUuidActive == self.viewModel.capsules[i].uuid {
126
                if self.capsuleUuidActive == self.viewModel.capsules[i].uuid {
125
                    self.scrollToIndex = i
127
                    self.scrollToIndex = i
126
                }
128
                }
127
                i += 1
129
                i += 1
128
            }
130
            }