Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created March 4, 2020 14:37
Show Gist options
  • Save azamsharp/3265a9749620edfea8ed412c7e380218 to your computer and use it in GitHub Desktop.
Save azamsharp/3265a9749620edfea8ed412c7e380218 to your computer and use it in GitHub Desktop.
static func required(errorMessage: String = "Is Empty") -> Validation {
return .init { value in
value.isEmpty ? .failure(.init(message: errorMessage)) : .success(())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment