Proyectos de Subversion Iphone Microlearning

Rev

Autoría | Ultima modificación | Ver Log |

//
//  HtmlView.swift
//  twogetskills
//
//  Created by Efrain Yanez Recanatini on 4/26/22.
//

import Foundation

import Foundation
import SwiftUI
import PDFKit


struct WebViewerView: View {
    @Environment(\.presentationMode)
       var presentationMode: Binding
    
    //@State private var backToGallery : Bool = false
    @State private var isCompleted : Bool = false
    
    private var content : String

    private var slideName : String;
    
    
    private let colorBackgroundTopic = UIColor(hex: Config.COLOR_BACKGROUND_TOPIC)
    
    private let colorAppTextView = UIColor(hex: Config.COLOR_APP_TEXT_VIEW_TITLE)

    private let colorAppBackground = UIColor(hex: Config.COLOR_APP_BAR)
    
    
    init(content : String, slideName : String)
    {
        self.content = content
            
   
        self.slideName = slideName
       
       


    }
    
    var body: some View {
        //GeometryReader { geometry in
            VStack {
                WebViewRepresentedView(content: content)
            }
            .background(Color(colorBackgroundTopic ?? .gray))
            .navigationBarBackButtonHidden(true)
            .navigationBarTitleDisplayMode(.inline)
            .navigationTitle(slideName)
            .toolbar {
                ToolbarItem(placement: .navigationBarLeading) {
                    Button(action: {
                      
                        self.presentationMode.wrappedValue.dismiss()
                        
                        
                    }) {
                        HStack {
                            Image(systemName: "chevron.backward")
                                .aspectRatio(contentMode: .fit)
                                .foregroundColor(Color( colorAppTextView ?? .systemBlue))
                                .background(Color(colorAppBackground ?? .systemBlue))
                        }
                    }
                
                }
            }
           
        //}
    }
    
    

    
}


struct WebViewerView_Previews: PreviewProvider {
    static var previews: some View {
        WebViewerView(
            content :  "<html><head></head><body><h1>Test</h1></body></html>",
            slideName:  "")
    }
}