8

I'm using a SFSafariViewController. The initial url that loads redirects to another url. I need to get the current url bar that SFSafariViewController has.

It's successfully redirecting because I can see it in the url bar but I got no access not even from delegate methods.

Before that, I was using UIWebView and it worked fine but suddenly it doesn't redirect anymore.

This is my code for SFSafariViewController:

    override func viewDidAppear(_ animated: Bool) {

    safari = SFSafariViewController(url: URL(string:"https://api.instagram.com/oauth/authorize/?client_id=client_code&redirect_uri=http://localhost&response_type=code")!)

    safari.delegate = self

    self.present(safari, animated: true, completion: nil)

}

It's presenting rightly but I need access to the current url.

Thanks in advance.

JoseMartinFit
  • 335
  • 4
  • 13
  • 1
    Possible duplicate of [How to get an URL from SFSafariViewController?](https://stackoverflow.com/questions/33369164/how-to-get-an-url-from-sfsafariviewcontroller) – Jeremy Oct 12 '17 at 17:28

0 Answers0