---
title: "layoutManager(_:shouldUse:forControlCharacterAt:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nslayoutmanagerdelegate/layoutmanager(_:shoulduse:forcontrolcharacterat:)"
---

# layoutManager(_:shouldUse:forControlCharacterAt:)

Returns the control character action for the control character at the specified character index.

## Declaration

```swift
optional func layoutManager(_ layoutManager: NSLayoutManager, shouldUse action: NSLayoutManager.ControlCharacterAction, forControlCharacterAt charIndex: Int) -> NSLayoutManager.ControlCharacterAction
```

## Parameters

- `layoutManager`: The layout manager doing the layout.
- `action`: The proposed control character action for the character at the given index. Possible values are enumerated by doc://com.apple.uikit/documentation/UIKit/NSLayoutManager/ControlCharacterAction.
- `charIndex`: The index of the control character for which the action is proposed.

## Return Value

Return Value The control character action for the control character at the given index.

## See Also

### Invalidating glyphs and layout

- [layoutManagerDidInvalidateLayout(_:)](uikit/nslayoutmanagerdelegate/layoutmanagerdidinvalidatelayout(_:).md)
- [layoutManager(_:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:)](uikit/nslayoutmanagerdelegate/layoutmanager(_:shouldgenerateglyphs:properties:characterindexes:font:forglyphrange:).md)
- [NSLayoutManager.ControlCharacterAction](uikit/nslayoutmanager/controlcharacteraction.md)
