Type Method

path(withComponents:)

Returns a string built from the strings in a given array by concatenating them with a path separator between each pair.

Declaration

class func path(withComponents components: [String]) -> String

Parameters

components

An array of NSString objects representing a file path. To create an absolute path, use a slash mark (“/”) as the first component. To include a trailing path divider, use an empty string as the last component.

Return Value

A string built from the strings in components by concatenating them (in the order they appear in the array) with a path separator between each pair.

Discussion

This method doesn’t clean up the path created; use standardizingPath to resolve empty components, references to the parent directory, and so on.

See Also

Related Symbols

var pathComponents: [String]

The file-system path components of the receiver.