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 given URLMatchable, negating it’s matches result.

    Declaration

    Swift

    public init(_ matchable: URLMatchable)

    Parameters

    matchable

    The URLMatchable to be negated.

  • A predicate that determines whether Not matches a given URL.

    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 if matches of the wrapped value returns false. Otherwise, false.