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 8
Línea 6... Línea 6...
6
//
6
//
Línea 7... Línea 7...
7
 
7
 
Línea 8... Línea 8...
8
import SwiftUI
8
import SwiftUI
-
 
9
 
-
 
10
struct CommentAndRatingImageView: View {
-
 
11
    
-
 
12
    var capsuleModel : CapsuleModel
9
 
13
    
Línea 10... Línea 14...
10
struct CommentAndRatingImageView: View {
14
    
11
    var body: some View {
15
    var body: some View {
12
       
16
       
Línea 13... Línea 17...
13
            Group {
17
            Group {
-
 
18
                HStack {
-
 
19
                    Spacer()
-
 
20
                    
-
 
21
                    Group {
-
 
22
                    
-
 
23
                        if self.capsuleModel.image.isEmpty {
14
                HStack {
24
                        
15
                    Spacer()
25
                        
-
 
26
                        Image(uiImage: UIImage(named: "logo") ?? UIImage())
-
 
27
                            .resizable()
-
 
28
                            .resizable()
-
 
29
                            .aspectRatio(contentMode: .fit)
-
 
30
                               
-
 
31
                           
-
 
32
                        
-
 
33
                    } else {
-
 
34
                        CustomAsyncImage(
-
 
35
                            url: URL(string: self.capsuleModel.image)!,
-
 
36
                            placeholder: { Text(Config.LANG_COMMON_LOADING).font(.footnote).foregroundColor(.black)},
-
 
37
                            image: {
-
 
38
                                Image(uiImage: $0).resizable()
-
 
39
                              
16
                    
40
                                       
17
                    Image("logo")
41
                            }
Línea 18... Línea 42...
18
                        .resizable()
42
                        )
19
                        .aspectRatio(contentMode: .fit)
43
                    }
20
                        .background(Color("color_window_background"))
44
                    }.background(Color("color_window_background"))
Línea 34... Línea 58...
34
   
58
   
35
    }
59
    }
Línea 36... Línea 60...
36
}
60
}
-
 
61
 
-
 
62
struct CommentAndRatingImageView_Previews: PreviewProvider {
37
 
63
    static var capsuleModel = CapsuleModel()
38
struct CommentAndRatingImageView_Previews: PreviewProvider {
64
    
39
    static var previews: some View {
65
    static var previews: some View {
40
        CommentAndRatingImageView()
66
        CommentAndRatingImageView(capsuleModel: capsuleModel)