---
title: "add(_:)"
framework: xctest
role: symbol
role_heading: Instance Method
path: "xctest/xctactivity/add(_:)"
---

# add(_:)

Associates a file, image, or other attachment with the activity.

## Declaration

```swift
func add(_ attachment: XCTAttachment)
```

## Mentioned in

Adding Attachments to Tests, Activities, and Issues
