I obtained the following code from here to open all other links that do not match my domain in Safari:
func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {
if navigationType == UIWebViewNavigationType.LinkClicked {
UIApplication.sharedApplication().openURL(request.URL!)
return false
}
return true
}
Although how can I allow another specified domain to be opened within my UIWebView
instead of Safari, such as paypal.com
?