Functions

The following functions are available globally.

  • Overrides the Pattern Match Operator to allow a given URL to be matched by some URLMatchable in context of a switch.

    Example:

    switch URL(string: "http://example.com")! {
    case Host("example.com"):
      // ...
    default:
      // ...
    }
    

    Declaration

    Swift

    public func ~= (pattern: URLMatchable, value: URL) -> Bool