---
title: "ensureAttributesAreFixed(in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextstorage/ensureattributesarefixed(in:)"
---

# ensureAttributesAreFixed(in:)

Ensures that attribute fixing occurs in the specified range.

## Declaration

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

## Parameters

- `range`: The range of characters to examine.

## Discussion

Discussion An NSTextStorage object using lazy attribute fixing is required to call this method before accessing any attributes within range. This method gives attribute fixing a chance to occur if necessary. NSTextStorage subclasses wishing to support laziness must call this method from all attribute accessors they implement.

## See Also

### Fixing the string attributes

- [invalidateAttributes(in:)](uikit/nstextstorage/invalidateattributes(in:).md)
- [fixesAttributesLazily](uikit/nstextstorage/fixesattributeslazily.md)
