Not
public struct Not : URLMatchable
A wrapper for a URLMatchable
that matches a URL whenever its wrapped value does not.
Usage:
let url = URL(string: "http://example.com")!
Not(Host("example.com")).matches(url) //> false
Not(Scheme.mailto).matches(url) //> true
-
Creates a
Not
value that wraps the givenURLMatchable
, negating it’smatches
result.Declaration
Swift
public init(_ matchable: URLMatchable)
Parameters
matchable
The
URLMatchable
to be negated. -
A predicate that determines whether
Not
matches a givenURL
.In other words,
Not
matches is the inverse of its wrapped value.Declaration
Swift
public func matches(url: URL) -> Bool
Parameters
url
The
URL
to be matched.Return Value
true
ifmatches
of the wrapped value returnsfalse
. Otherwise,false
.