Instance Method

appendingPathExtension(_:)

Returns a URL constructed by appending the given path extension to self.

Declaration

func appendingPathExtension(_ pathExtension: String) -> URL

Parameters

pathExtension

The extension to append.

Discussion

If the URL has an empty path (e.g., http://www.example.com), then this function will return the URL unchanged.

Certain special characters (for example, Unicode Right-To-Left marks) cannot be used as path extensions. If any of those are contained in pathExtension, the function will return the URL unchanged.

See Also

Adding a Path Extension

func appendPathExtension(String)

Appends the given path extension to self.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software