Proyectos de Subversion Iphone Microlearning

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
//
2
//  HtmlView.swift
3
//  twogetskills
4
//
5
//  Created by Efrain Yanez Recanatini on 4/26/22.
6
//
7
 
8
import Foundation
9
 
10
import Foundation
11
import SwiftUI
12
import PDFKit
13
 
14
 
15
struct WebViewerView: View {
16
    @Environment(\.presentationMode)
17
       var presentationMode: Binding
18
 
19
    //@State private var backToGallery : Bool = false
20
    @State private var isCompleted : Bool = false
21
 
22
    private var content : String
23
 
24
    private var slideName : String;
25
 
26
 
27
    private let colorBackgroundTopic = UIColor(hex: Config.COLOR_BACKGROUND_TOPIC)
28
 
29
    private let colorAppTextView = UIColor(hex: Config.COLOR_APP_TEXT_VIEW_TITLE)
30
 
31
    private let colorAppBackground = UIColor(hex: Config.COLOR_APP_BAR)
32
 
33
 
34
    init(content : String, slideName : String)
35
    {
36
        self.content = content
37
 
38
 
39
        self.slideName = slideName
40
 
41
 
42
 
43
 
44
    }
45
 
46
    var body: some View {
47
        //GeometryReader { geometry in
48
            VStack {
49
                WebViewRepresentedView(content: content)
50
            }
51
            .background(Color(colorBackgroundTopic ?? .gray))
52
            .navigationBarBackButtonHidden(true)
53
            .navigationBarTitleDisplayMode(.inline)
54
            .navigationTitle(slideName)
55
            .toolbar {
56
                ToolbarItem(placement: .navigationBarLeading) {
57
                    Button(action: {
58
 
59
                        self.presentationMode.wrappedValue.dismiss()
60
 
61
 
62
                    }) {
63
                        HStack {
64
                            Image(systemName: "chevron.backward")
65
                                .aspectRatio(contentMode: .fit)
66
                                .foregroundColor(Color( colorAppTextView ?? .systemBlue))
67
                                .background(Color(colorAppBackground ?? .systemBlue))
68
                        }
69
                    }
70
 
71
                }
72
            }
73
 
74
        //}
75
    }
76
 
77
 
78
 
79
 
80
}
81
 
82
 
83
struct WebViewerView_Previews: PreviewProvider {
84
    static var previews: some View {
85
        WebViewerView(
86
            content :  "<html><head></head><body><h1>Test</h1></body></html>",
87
            slideName:  "")
88
    }
89
}
90
 
91
 
92
 
93