---
title: readFileWrapper()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nspasteboard/readfilewrapper()
---

# readFileWrapper()

Reads data representing a file’s contents from the receiver and returns it as a file wrapper.

## Declaration

```swift
func readFileWrapper() -> FileWrapper?
```

## Return Value

Return Value A file wrapper containing the pasteboard data, or nil if the receiver contained no data of type NSFileContentsPboardType.

## Discussion

Discussion In macOS 10.5 and earlier, the file contents pboard type allowed you to synthesize a pboard type for a file’s contents based on the file’s extension. In macOS 10.5 and later, using the UTI of a file to represent its contents now replaces this functionality.

## See Also

### Reading data (macOS 10.5 and earlier)

- [readFileContentsType(_:toFile:)](appkit/nspasteboard/readfilecontentstype(_:tofile:).md)
