WKWebView open in new viewcontroller

I am facing a problem, in an early fase of my app. I am trying to open at link from WkWebview in a new viewcontroller, with another WKWebview. The reason is, that i am having some buttons in the second viewcontroller. Is this possible in Xcode/Swift?

Regards Frederik

Upvotes: 0

Views: 731

Answers (1)

DerDingens
DerDingens

Reputation: 382

Take a look at https://developer.apple.com/documentation/webkit/wknavigationdelegate . Inside the decidepolicyfor-method, you can analyze the request url and do some custom stuff, like opening it somewhere else.

You obviously have to implement a delegate somewhere, either as an additional class or inside your Viewcontroller.

Upvotes: 1

Related Questions