Contents

appending(path:directoryHint:)

Returns a URL by appending the specified path to the URL, with a hint for handling directory awareness.

Declaration

func appending<S>(path: S, directoryHint: URL.DirectoryHint = .inferFromPath) -> URL where S : StringProtocol

Parameters

  • path:

    The path to add.

  • directoryHint:

    A hint to the method to indicate whether the path is a directory, or to instruct the method to make this determination. Defaults to Inferfrompath.

Mentioned in

Return Value

A new URL that appends the specified path to the original URL.

Discussion

This method doesn’t percent-encode any path separators (/) in the path component before appending the component to the path. If you want this encoding, use appending(component:directoryHint:) instead.

See Also

Adding path components