Instance Method

appendPathExtension(_:)

Appends the given path extension to self.

Declaration

mutating func appendPathExtension(_ pathExtension: String)

Parameters

pathExtension

The extension to append.

Discussion

If the URL has an empty path (e.g., http://www.example.com), then this function will do nothing. 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 appendingPathExtension(String) -> URL

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