<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSExtensionItem/attachments",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSExtensionItem(py)attachments"
  },
  "title" : "attachments"
}
-->

# attachments

An optional array of media data associated with the extension item.

```
var attachments: [NSItemProvider]? { get set }
```

## Discussion

Populate this array with images, videos, URLs, and so on. It’s not meant to be an array of alternative data formats or types, but is instead a collection to include in a social media post, for example. These items are always typed [`NSItemProvider`](/documentation/Foundation/NSItemProvider).

> Important:
> Alternatively, you can set attachments in the ``doc://com.apple.foundation/documentation/Foundation/NSExtensionItem/userInfo`` dictionary using the ``doc://com.apple.foundation/documentation/Foundation/NSExtensionItemAttachmentsKey`` key. However, setting the ``doc://com.apple.foundation/documentation/Foundation/NSExtensionItem/userInfo`` dictionary after setting ``doc://com.apple.foundation/documentation/Foundation/NSExtensionItem/attachments`` will override this property.

---

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)