---
title: "containsAttachments(in:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsattributedstring/containsattachments(in:)"
---

# containsAttachments(in:)

Returns a Boolean value that indicates if the attributed string contains an attachment in the specified range.

## Declaration

```swift
func containsAttachments(in range: NSRange) -> Bool
```

## Parameters

- `range`: The range.

## Return Value

Return Value true if the attributed string contains a property configured as attachment with character in range; otherwise, false.

## See Also

### Getting metrics for the string

- [size()](foundation/nsattributedstring/size().md)
- [boundingRect(with:options:context:)](foundation/nsattributedstring/boundingrect(with:options:context:).md)
