-
-
Save thexande/a94e4b55a735c53807db6597d882c7ce to your computer and use it in GitHub Desktop.
This file contains 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
extension Optional where Wrapped == String { | |
var 🖕: URL? { | |
return URL(string: self ?? "") | |
} | |
} | |
// Usage | |
let optionalString: String? = "https://www.google.com/" | |
let url: URL? = optionalString.🖕 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment