URI

public struct URI : Encodable
extension URI: Equatable
extension URI: CustomStringConvertible

A convenience API to communicate with URLComponents.

  • A default URI /.

    Declaration

    Swift

    public static var `default`: `Self` { get }
  • A scheme subcomponent of URLComponents.

    Declaration

    Swift

    public var scheme: String? { get }
  • A host subcomponent of URLComponents.

    Declaration

    Swift

    public var host: String? { get }
  • A port subcomponent of URLComponents.

    Declaration

    Swift

    public var port: Int? { get }
  • url

    A url subcomponent of URLComponents.

    Declaration

    Swift

    public var url: URL? { get }
  • A URL string of URLComponents.

    Declaration

    Swift

    public var string: String? { get }
  • A path subcomponent of URLComponents.

    Declaration

    Swift

    public var path: String? { get }
  • Query parameters.

    Declaration

    Swift

    public private(set) var query: [String : String] { get }
  • Fragment.

    Declaration

    Swift

    public var fragment: String? { get }
  • Initializes a new instance with a URL string.

    Warning

    Returns nil if the string is not a valid URL string.

    Declaration

    Swift

    public init?(string: String)

    Parameters

    string

    A URL string.

  • Undocumented

    Declaration

    Swift

    public func getQuery<T>(_ name: String) -> T?
  • See Equatable.

    Declaration

    Swift

    public static func == (lhs: URI, rhs: URI) -> Bool
  • See CustomStringConvertible.

    Declaration

    Swift

    public var description: String { get }