---
title: "scrollRangeToVisible(_:inDocument:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextsearching-3wkjv/scrollrangetovisible(_:indocument:)"
---

# scrollRangeToVisible(_:inDocument:)

Scrolls to the containing view to make the text range visible.

## Declaration

```swift
func scrollRangeToVisible(_ range: UITextRange, inDocument: Self.DocumentIdentifier?)
```

## Parameters

- `range`: The text range to scroll to.
- `inDocument`: A string that uniquely identifies the document containing the text range. Nil when searching a single document.

## Discussion

Discussion If the seachable object supports scrolling, use this method to implement scrolling your view to make the highlighted text range visible.

## See Also

### Displaying results

- [decorate(foundTextRange:document:usingStyle:)](uikit/uitextsearching-3wkjv/decorate(foundtextrange:document:usingstyle:).md)
- [clearAllDecoratedFoundText()](uikit/uitextsearching-3wkjv/clearalldecoratedfoundtext().md)
- [willHighlight(foundTextRange:document:)](uikit/uitextsearching-3wkjv/willhighlight(foundtextrange:document:).md)
