String

@frozen
extension String: URLConvertible
  • Returns a URL if self can be used to initialize a URL instance, otherwise throws.

    Throws

    An AFError.invalidURL instance.

    Declaration

    Swift

    public func asURL() throws -> URL

    Return Value

    The URL initialized with self.