---
title: estimatedAttachmentByteCount
framework: testing
role: symbol
role_heading: Instance Property
path: testing/attachable/estimatedattachmentbytecount
---

# estimatedAttachmentByteCount

An estimate of the number of bytes of memory needed to store this value as an attachment.

## Declaration

```swift
var estimatedAttachmentByteCount: Int? { get }
```

## Discussion

Discussion The testing library uses this property to determine if an attachment should be held in memory or should be immediately saved. Larger attachments are more likely to be saved immediately, but the algorithm the testing library uses is an implementation detail and is subject to change. The value of this property is approximately equal to the number of bytes that will actually be needed, or nil if the value cannot be computed efficiently. The default implementation of this property returns nil. note: O(1) unless Self conforms to Collection, in which case up to O(n) where n is the length of the collection.
