---
title: contents
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/nstextattachment/contents
---

# contents

The contents for the text attachment.

## Declaration

```swift
var contents: Data? { get set }
```

## Discussion

Discussion Modifying this property has the side effect of invalidating the image property.

## See Also

### Defining the attachment’s contents

- [bounds](uikit/nstextattachment/bounds.md)
- [fileType](uikit/nstextattachment/filetype.md)
- [image](uikit/nstextattachment/image.md)
- [fileWrapper](uikit/nstextattachment/filewrapper.md)
- [allowsTextAttachmentView](uikit/nstextattachment/allowstextattachmentview.md)
- [usesTextAttachmentView](uikit/nstextattachment/usestextattachmentview.md)
- [lineLayoutPadding](uikit/nstextattachment/linelayoutpadding.md)
