EmailPredicate
public struct EmailPredicate : Predicate
The EmailPredicate
struct is used to evaluate whether a given input is a syntactically valid email address, based on the RFC 5322 official standard.
-
Declaration
Swift
public typealias InputType = String
-
Creates and returns a new
EmailPredicate
instance.Declaration
Swift
public init()
-
Returns a
Boolean
value that indicates whether a given email is a syntactically valid, according to the RFC 5322 official standard.Declaration
Swift
public func evaluate(with input: InputType) -> Bool
Parameters
input
The input against which to evaluate the receiver.
Return Value
true
if input is a syntactically valid email, according to the RFC 5322 standard, otherwisefalse
.