Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

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

Rev 1 Rev 32
Línea 6... Línea 6...
6
//
6
//
Línea 7... Línea 7...
7
 
7
 
Línea 8... Línea 8...
8
import Foundation
8
import Foundation
9
 
9
 
10
 
10
 
-
 
11
class GalleryGridViewModel : ObservableObject
-
 
12
{
-
 
13
    @Published public var slides = [SlideModel]()
-
 
14
    @Published public var slideActiveIndex : Int = 0
-
 
15
    
-
 
16
    
-
 
17
    func next() -> Void {
-
 
18
        if slideActiveIndex < (slides.count - 1) {
-
 
19
            slideActiveIndex += 1
-
 
20
        }
-
 
21
    }
-
 
22
    
-
 
23
    func previous() -> Void {
-
 
24
        if slideActiveIndex > 0 {
-
 
25
            slideActiveIndex -= 1
-
 
26
        }
-
 
27
    }
-
 
28
    
-
 
29
    func hasNext() -> Bool {
-
 
30
        return slideActiveIndex < (slides.count - 1)
-
 
31
    }
-
 
32
    
Línea 11... Línea 33...
11
class GalleryGridViewModel
33
    func hasPrevious() -> Bool {
12
{
34
        return slideActiveIndex > 0
13
    var slides = [SlideModel]()
35
    }
-
 
36
 
14
 
37
    func fetch(capsuleUuid : String, userUuid : String)
Línea 15... Línea 38...
15
    func fetch(capsuleUuid : String, userUuid : String)
38
    {
16
    {
39
        let slideDao = SlideDao.sharedInstance