Contents

appendingPathExtension(_:)

Returns a URL by appending the specified path extension to self.

Declaration

func appendingPathExtension(_ pathExtension: String) -> URL

Parameters

  • pathExtension:

    The extension to append.

Discussion

If the URL has an empty path, such as http://www.example.com, this function returns an unchanged URL.

Certain special characters (for example, Unicode right-to-left marks) can’t be path extensions. If pathExtension contains any of those characters, the function returns an unchanged URL.

See Also

Adding a path extension