Nick Nick - 5 months ago 13
Swift Question

how to get URL from webview in swift

I am trying to do some sort of web trapping. I have an app that consist of a webview and calls on a mobile website. I want to be able to make the app do a few different things when certain links are hit. For instance, open in Safari or something like this. I was thinking of just doing something like if the url equals www.example1.com go to www.example2.com. I am not sure on how to do this or if it will work. If you know how to help or have any resources I haven't been able to find, I would appreciate them.

Answer

Well, there is a request property that can be used to get the current request URL. I think you should try to use it.

Comments