Instance MethodFoundationEssentials
append(component:directoryHint:)
iOS 16.0+
iPadOS 16.0+
Mac Catalyst 16.0+
macOS 13.0+
tvOS 16.0+
watchOS 9.0+
Appends a path component to the receiver. For non-file URLs, this method percent-encodes any path separators (
/) in the path component before appending.mutating func append<S>(component: S, directoryHint: URL.DirectoryHint = .inferFromPath) where S : StringProtocol
Parameters
componentA path component to append to the receiver.
directoryHintA hint to whether this URL will point to a directory.
Discussion
Note
For compatibility, this method does not percent-encode any path separators (/) if the URL has a file scheme.