String
extension String: URLConvertible
-
Returns a
URL
if theString
can be used to initialize aURL
, otherwise throws if an error was encountered.Throws
AURLError.invalidURL
error.Declaration
Swift
public func asURL() throws -> URL
Return Value
The
URL
initialized with theString
.