Answer the question
In order to leave comments, you need to log in
How to follow external link in WebView osx Swift?
Hello, I'm writing my first application in Swift.
There is a WebView where I open the site:
let defaultURL = "https://yandex.ru"
override func viewDidLoad() {
self.EasyW.frameLoadDelegate = self
self.EasyW.policyDelegate = self
self.EasyW.mainFrame.loadRequest(NSURLRequest(URL: NSURL(string: defaultURL)!))
}
Answer the question
In order to leave comments, you need to log in
you need to bind an action to a button (IBAction) and write inside the function
let defaultURL = NSURL(string: "https://yandex.ru")!
UIApplication.sharedApplication().openURL(defaultURL!)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question