Skip to content

Instantly share code, notes, and snippets.

@s4cha
Created July 19, 2018 14:18
Show Gist options
  • Select an option

  • Save s4cha/2032576133bf893b35fc770874662024 to your computer and use it in GitHub Desktop.

Select an option

Save s4cha/2032576133bf893b35fc770874662024 to your computer and use it in GitHub Desktop.
public extension Optional where Wrapped == String {
var isEmptyOrNil: Bool { return (self ?? "").isEmpty }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment