<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSLayoutManagerDelegate/layoutManager(_:shouldUse:forControlCharacterAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSLayoutManagerDelegate(im)layoutManager:shouldUseAction:forControlCharacterAtIndex:"
  },
  "title" : "layoutManager(_:shouldUse:forControlCharacterAt:)"
}
-->

# layoutManager(_:shouldUse:forControlCharacterAt:)

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

```
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 [`NSLayoutManager.ControlCharacterAction`](/documentation/AppKit/NSLayoutManager/ControlCharacterAction).

`charIndex`

The index of the control character for which the action is proposed.

## Return Value

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

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)