Prevent user from leaving website in Swift
问题 I want to create a WebView in an iPad-App, that displays a website. I want to prevent the user to click on links that link to other websites (e.g. Facebook, Twitter, ...) but he should be allowed to move around on the current website freely. How can I achieve this? I tried with: func webView(WebViewNews: UIWebView!, shouldStartLoadWithRequest request: NSURLRequest!, navigationType: UIWebViewNavigationType) -> Bool { let newWebsite:String = (request.URL?.path)! print(newWebsite) if newWebsite