---
title: "CTLineEnumerateCaretOffsets(_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctlineenumeratecaretoffsets(_:_:)"
---

# CTLineEnumerateCaretOffsets(_:_:)

Enumerates caret offsets for characters in a line.

## Declaration

```swift
func CTLineEnumerateCaretOffsets(_ line: CTLine, _ block: @escaping (Double, CFIndex, Bool, UnsafeMutablePointer<Bool>) -> Void)
```

## Parameters

- `line`: The line to enumerate.
- `block`: The block to invoke once for each logical caret edge in the line, in left-to-right visual order. The block’s offset parameter is relative to the line origin. The block’s leadingEdge parameter specifies logical order.

## See Also

### Getting Line Positioning

- [CTLineGetStringIndexForPosition(_:_:)](coretext/ctlinegetstringindexforposition(_:_:).md)
- [CTLineGetOffsetForStringIndex(_:_:_:)](coretext/ctlinegetoffsetforstringindex(_:_:_:).md)
