---
title: "init(serializedRepresentation:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/filewrapper/init(serializedrepresentation:)"
---

# init(serializedRepresentation:)

Initializes the receiver as a regular-file file wrapper from given serialized data.

## Declaration

```swift
init?(serializedRepresentation serializeRepresentation: Data)
```

## Parameters

- `serializeRepresentation`: Serialized representation of a file wrapper in the format used for the NSFileContentsPboardType pasteboard type. Data of this format is returned by such methods as doc://com.apple.foundation/documentation/Foundation/FileWrapper/serializedRepresentation and doc://com.apple.foundation/documentation/Foundation/NSAttributedString/rtfd(from:documentAttributes:) (doc://com.apple.foundation/documentation/Foundation/NSAttributedString).

## Return Value

Return Value Regular-file file wrapper initialized from serializedRepresentation.

## Discussion

Discussion The file wrapper is not associated with a file-system node until you save it using write(to:options:originalContentsURL:).

## See Also

### Related Documentation

- [preferredFilename](foundation/filewrapper/preferredfilename.md)
- [filename](foundation/filewrapper/filename.md)
- [fileAttributes](foundation/filewrapper/fileattributes.md)

### Creating File Wrappers

- [init(url:options:)](foundation/filewrapper/init(url:options:)-70161.md)
- [init(path:)](foundation/filewrapper/init(path:).md)
- [init(directoryWithFileWrappers:)](foundation/filewrapper/init(directorywithfilewrappers:).md)
- [init(regularFileWithContents:)](foundation/filewrapper/init(regularfilewithcontents:).md)
- [init(symbolicLinkWithDestination:)](foundation/filewrapper/init(symboliclinkwithdestination:).md)
- [init(symbolicLinkWithDestinationURL:)](foundation/filewrapper/init(symboliclinkwithdestinationurl:).md)
