---
title: "init(compressedContentsOfDirectory:)"
framework: xctest
role: symbol
role_heading: Initializer
path: "xctest/xctattachment/init(compressedcontentsofdirectory:)"
---

# init(compressedContentsOfDirectory:)

## Declaration

```swift
convenience init(compressedContentsOfDirectory url: URL)
```

## Discussion

Discussion Creates an attachment with an existing directory on disk. Automatically zips the directory, the content type is “public.zip-archive”.
