Contents

appendingPathExtension(_:)

Returns a new URL by appending a path extension to the original URL.

Declaration

func appendingPathExtension(_ pathExtension: String) -> URL?

Parameters

  • pathExtension:

    The path extension to add to the URL.

Return Value

A new URL with pathExtension appended.

Discussion

If the original URL ends with one or more forward slashes, these are removed from the returned URL. A period is inserted between the two parts of the new URL.

See Also

Modifying and Converting a File URL