---
title: "fixAttachmentAttribute(in:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutableattributedstring/fixattachmentattribute(in:)"
---

# fixAttachmentAttribute(in:)

Cleans up attachment attributes in the specified range and removes all attachment attributes assigned to characters except the designated attachment character.

## Declaration

```swift
func fixAttachmentAttribute(in range: NSRange)
```

## Parameters

- `range`: The range of characters.

## Discussion

Discussion The method preserves the attachment attribute on the character special character. The method raises a rangeException if any part of range lies beyond the end of the string’s characters.

## See Also

### Fixing Attributes After Changes

- [fixAttributes(in:)](foundation/nsmutableattributedstring/fixattributes(in:).md)
- [fixFontAttribute(in:)](foundation/nsmutableattributedstring/fixfontattribute(in:).md)
- [fixParagraphStyleAttribute(in:)](foundation/nsmutableattributedstring/fixparagraphstyleattribute(in:).md)
