---
title: "textStyling(at:in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextinput/textstyling(at:in:)"
---

# textStyling(at:in:)

Returns a dictionary with properties that specify how to style the text at a certain location in a document.

## Declaration

```swift
optional func textStyling(at position: UITextPosition, in direction: UITextStorageDirection) -> [NSAttributedString.Key : Any]?
```

## Parameters

- `position`: An object that indicates a location in the text of a document.
- `direction`: The direction of the styling attributes in text storage.

## Return Value

Return Value A dictionary whose elements are one or more of the key-value pairs defining text color, font, and background color. See Style dictionary keys for descriptions of these key-value pairs.

## Discussion

Discussion Text styling information can affect, for example, the appearance of a correction rectangle.
