<!--
{
  "availability" : [
    "Swift: 6.3.0 -",
    "Xcode: 26.4.0 -",
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "swift: 6.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/AttachableAsImage",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "s:7Testing17AttachableAsImageP"
  },
  "title" : "AttachableAsImage"
}
-->

# AttachableAsImage

A protocol describing images that can be converted to instances of
[`Attachment`](https://developer.apple.com/documentation/testing/attachment).

```
protocol AttachableAsImage
```

## Overview

Instances of types conforming to this protocol do not themselves conform to
[`Attachable`](https://developer.apple.com/documentation/testing/attachable).
Instead, the testing library provides additional initializers on [`Attachment`](https://developer.apple.com/documentation/testing/attachment)
that take instances of such types and handle converting them to image data when needed.

You do not generally need to add your own conformances to this protocol. For
a list of types that automatically conform to this protocol, see
[Attach images](/documentation/Testing/Attachments#Attach-images).

---

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)