Skip to content

Instantly share code, notes, and snippets.

@dmlebron
Last active November 6, 2018 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmlebron/ac1f7b65b2d5f5b1c6ac764417c8a274 to your computer and use it in GitHub Desktop.
Save dmlebron/ac1f7b65b2d5f5b1c6ac764417c8a274 to your computer and use it in GitHub Desktop.
extension Optional where Wrapped == Bool {
var unwrappedOrFalse: Bool {
switch self {
case .some(let unwrapped):
return unwrapped
case .none:
return false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment