Last active
April 20, 2022 15:41
-
-
Save sigidhanafi/fce0aee16898d0022c3830d4e1923918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let urlString = "" | |
// converting value to nil, if it error | |
let result = try? validateUrl(urlString: urlString) | |
// handle optional value | |
if result != nil { | |
print("the url is valid") | |
} else { | |
print("the url is not valid") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment