Ferrite-backup/Ferrite/Views/RepresentableViews/WebView.swift
kingbri 17867db40c Debrid: Add Premiumize support and cleanup
Premiumize is another debrid provider. Add support in addition
to other debrid services.

Add a unified Magnet type that encloses both the link and hash
when needed for certain services.

A universal ASAuthenticationSession has been added to make implicit
authentication easier for services that support it.

Clean up declarations of certain variables that were mismanaged
during the debrid decentralization process.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-12-05 18:10:10 -05:00

31 lines
736 B
Swift

//
// WebView.swift
// Ferrite
//
// Created by Brian Dashore on 7/17/22.
//
import SwiftUI
import WebKit
struct WebView: UIViewRepresentable {
var url: URL
func makeUIView(context: Context) -> WKWebView {
// Make the WebView ephemeral
let config = WKWebViewConfiguration()
config.websiteDataStore = WKWebsiteDataStore.nonPersistent()
let webView = WKWebView(frame: .zero, configuration: config)
let _ = webView.load(URLRequest(url: url))
return webView
}
func updateUIView(_ uiView: WKWebView, context: Context) {}
}
struct WebView_Previews: PreviewProvider {
static var previews: some View {
WebView(url: URL(string: "https://google.com")!)
}
}