Instance Method


Returns an array of strings representing the user-visible components of a given path.


func componentsToDisplay(forPath path: String) -> [String]?



A pathname.

Return Value

An array of NSString objects representing the user-visible (for the Finder, Open and Save panels, and so on) components of path. Returns nil if path does not exist.


These components cannot be used for path operations and are only suitable for display to the user.

See Also

Getting and Setting Attributes

func displayName(atPath: String) -> String

Returns the display name of the file or directory at a specified path.

func attributesOfItem(atPath: String) -> [FileAttributeKey : Any]

Returns the attributes of the item at a given path.

func attributesOfFileSystem(forPath: String) -> [FileAttributeKey : Any]

Returns a dictionary that describes the attributes of the mounted file system on which a given path resides.

func setAttributes([FileAttributeKey : Any], ofItemAtPath: String)

Sets the attributes of the specified file or directory.