Skip to content

Instance MethodFoundationEssentials

appending(component:directoryHint:)

iOS 16.0+ iPadOS 16.0+ Mac Catalyst 16.0+ macOS 13.0+ tvOS 16.0+ watchOS 9.0+
Returns a URL constructed by appending the given path component to self. The path component is first percent-encoded before being appended to the receiver.
func appending<S>(component: S, directoryHint: URL.DirectoryHint = .inferFromPath) -> URL where S : StringProtocol

Parameters

component

A path component to append to the receiver.

directoryHint

A hint to whether this URL will point to a directory.

Return Value

The new URL