ScofieldNguyen
9/7/2017 - 5:44 AM

URL Validate

func isValidURL (urlString: String?) -> Bool {
    if let urlString = urlString {
        if let url  = NSURL(string: urlString) ?? NSURL(string: "http://" + urlString) {
            return UIApplication.shared.canOpenURL(url as URL)
        }
    }
    return false
}