Created
August 12, 2019 08:15
-
-
Save pchelnikov/686f4fd177c0b3bc2341cfb1238d64f7 to your computer and use it in GitHub Desktop.
Extensions for Swift Optional type
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
extension Optional where Wrapped == String { | |
func orEmpty() -> String { | |
return self ?? "" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment