---
title: "appendingPathExtension(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/url/appendingpathextension(_:)"
---

# appendingPathExtension(_:)

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

## Declaration

```swift
func appendingPathExtension(_ pathExtension: String) -> URL
```

## Parameters

- `pathExtension`: The extension to append.

## Discussion

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

- [appendPathExtension(_:)](foundation/url/appendpathextension(_:).md)
- [appendPathExtension(for:)](foundation/url/appendpathextension(for:).md)
- [appendingPathExtension(for:)](foundation/url/appendingpathextension(for:).md)
