Open link from WKWebKit in Safari

Hello,

I have inside my app a WKWebView which opens a webpage which contains a link to another external page. I want that external page to pe opened in Safari when accessed but I don't know how to do it.

This is how I define the view:

struct view : UIViewRepresentable {

    let request: URLRequest

    func makeUIView(context: Context) -> WKWebView  {
        return WKWebView()
    }

    func updateUIView(_ uiView: WKWebView, context: Context) {
        uiView.load(request)
    }
}

This is how I implement it:

view(request: URLRequest(url: URL(string: " [my url] ")!)).previewLayout(.fixed(width: .infinity, height: .infinity))

So if the url [my url] changes, than that link should be opened in Safari.

Thanks in advanced for the help.

Best regards, Alex Sofonea

Open link from WKWebKit in Safari
 
 
Q