---
title: "processEditing(for:edited:range:changeInLength:invalidatedRange:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nslayoutmanager/processediting(for:edited:range:changeinlength:invalidatedrange:)"
---

# processEditing(for:edited:range:changeInLength:invalidatedRange:)

Notifies the layout manager when an edit action changes the contents of its text storage object.

## Declaration

```swift
func processEditing(for textStorage: NSTextStorage, edited editMask: NSTextStorageEditActions, range newCharRange: NSRange, changeInLength delta: Int, invalidatedRange invalidatedCharRange: NSRange)
```

## Parameters

- `textStorage`: The text storage object processing edits.
- `editMask`: The types of edits done: NSTextStorageEditedAttributes, NSTextStorageEditedCharacters, or both.
- `newCharRange`: The range in the final string that was explicitly edited.
- `delta`: The length delta for the editing changes.
- `invalidatedCharRange`: The range of characters that changed as a result of attribute fixing. This invalidated range is either equal to newCharRange or larger.

## Discussion

Discussion The processEditing() method of NSTextStorage calls this method to notify the layout manager of an edit action. Layout managers must not change the contents of the text storage during the execution of this message.

## See Also

### Invalidating glyphs and layout

- [invalidateDisplay(forCharacterRange:)](appkit/nslayoutmanager/invalidatedisplay(forcharacterrange:).md)
- [invalidateDisplay(forGlyphRange:)](appkit/nslayoutmanager/invalidatedisplay(forglyphrange:).md)
- [invalidateGlyphs(forCharacterRange:changeInLength:actualCharacterRange:)](appkit/nslayoutmanager/invalidateglyphs(forcharacterrange:changeinlength:actualcharacterrange:).md)
- [invalidateLayout(forCharacterRange:actualCharacterRange:)](appkit/nslayoutmanager/invalidatelayout(forcharacterrange:actualcharacterrange:).md)
