Check if valid url WebView Swift

Solutions Collect From Internet About “Check if valid url WebView Swift”

Check the url by using canOpenURL from UIApplication

 if let url = NSURL(string: yourUrlString) {
    var canOpen = UIApplication.sharedApplication().canOpenURL(url)
 }