---
title: "componentsToDisplay(forPath:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/filemanager/componentstodisplay(forpath:)"
---

# componentsToDisplay(forPath:)

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

## Declaration

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

## Parameters

- `path`: A pathname.

## Return Value

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.

## Discussion

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

## See Also

### Getting and setting attributes

- [displayName(atPath:)](foundation/filemanager/displayname(atpath:).md)
- [attributesOfItem(atPath:)](foundation/filemanager/attributesofitem(atpath:).md)
- [attributesOfFileSystem(forPath:)](foundation/filemanager/attributesoffilesystem(forpath:).md)
- [setAttributes(_:ofItemAtPath:)](foundation/filemanager/setattributes(_:ofitematpath:).md)
