Created
July 18, 2022 16:59
-
-
Save knowsudhanshu/39f8ee041945f83f7e30db10dc7e9582 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
infix operator !! | |
func !!<T>(lhs: T?, rhs: T) -> T { | |
guard let lhs = lhs else { | |
return rhs | |
} | |
return lhs | |
} | |
var someVar: String? = "has value" | |
print(someVar !! "no value") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment