<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/containsAttachments",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAttributedString(py)containsAttachments"
  },
  "title" : "containsAttachments"
}
-->

# containsAttachments

A Boolean value that indicates whether the attribute string contains any attachment attributes.

```
var containsAttachments: Bool { get }
```

## Return Value

YES if the attributed string contains any attachment attributes, otherwise NO.

## Discussion

This method checks only for attachment attributes, not for `NSAttachmentCharacter`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)