         }
 
         func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
-//            viewModel.progress = 0
         }
 
         func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
-//            viewModel.progress = nil
         }
 
         func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
             if !error.isCancelled {
                 webView.errorPage(error: error)
             }
-//            viewModel.progress = nil
         }
     }
 }

struct WebView: View {
    var links = Links.load()

    @StateObject var viewModel = ViewModel()

    init() {
        viewModel.link = links.first
    }

    var body: some View {
        NavigationView {
            LinkWebView(viewModel: viewModel)
                .frame(maxWidth: .infinity, maxHeight: .infinity)
                .navigationBarBackButtonHidden(true)
                .navigationBarItems(
                    trailing:
                        Group {
                            Picker("", selection: $viewModel.link) {
                                ForEach(links, id: \.self) { link in
                                    Text(link.title)
                                        .tag(link as Link?)
                                }}
                                    .pickerStyle(SegmentedPickerStyle())
                                    .labelsHidden()

                            ProgressView(value: viewModel.progress,
                                         total: 1.0)
                                    .progressViewStyle(LinearProgressViewStyle())
                            //progressView.tintColor = #colorLiteral(red: 0.6576176882, green: 0.7789518833, blue: 0.2271372974, alpha: 1)
                        }
                )
        }
    }
}

class ViewModel: ObservableObject {

    @Published var link: Link?
    @Published var progress: Double?
}

struct WebView_Previews: PreviewProvider {

                let request = URLRequest(url: url)
                uiView.load(request)
            load(webView: uiView)
        }
    }

