I am using UIApplication.sharedApplication().openURL(url) to open a page in Safari.It is working fine , as far as opening the url in safari is concerned. But the problem is if that page is already opened in the safari and I call openURl method it just open that old page, not refreshing the content. I want to refresh it every time whenever I call opneURL . How to do that. ?
Asked
Active
Viewed 717 times
2
-
A possible easy solution, if you can, is implement a SFSafariViewController and open your URL within the app. At this stage you can control it like a UIWebView. http://stackoverflow.com/a/38395653/3307233 – Pankaj Gaikar Jul 25 '16 at 13:20
-
No I can not use the SFSafariViewController , client wants to open it in safari. – Aashish Nagar Jul 25 '16 at 13:23
-
Try opening the URI in private mode. Hope it will work. – Pankaj Gaikar Jul 25 '16 at 13:26
-
Can I do this programatically or user has to do manually ? – Aashish Nagar Jul 25 '16 at 13:55
1 Answers
0
I don't think it possible to refresh a page in Safari.
You could try this:
func showTutorial(url : String) {
if let url = NSURL(string: url) {
let vc = SFSafariViewController(URL: url, entersReaderIfAvailable: true)
presentViewController(vc, animated: true, completion: nil)
}
}
Please also read this: