---
title: "textContentStorage(_:textParagraphWith:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextcontentstoragedelegate/textcontentstorage(_:textparagraphwith:)"
---

# textContentStorage(_:textParagraphWith:)

Returns a custom paragraph for a range that you provide from the object’s attributed string.

## Declaration

```swift
optional func textContentStorage(_ textContentStorage: NSTextContentStorage, textParagraphWith range: NSRange) -> NSTextParagraph?
```

## Parameters

- `textContentStorage`: The object’s content manager.
- `range`: The doc://com.apple.documentation/documentation/Foundation/NSRange-c.struct that describes the extent of the string.

## Return Value

Return Value A new NSTextParagraph, or nil.

## Discussion

Discussion When non-nil, textContentStorage uses the text paragraph instead of creating the standard NSTextParagraph with the attributed substring in range. The attributed string for a custom text paragraph must have a length of range.length.
