---
title: "boundingBox(for:)"
framework: vision
role: symbol
role_heading: Instance Method
path: "vision/vnrecognizedtext/boundingbox(for:)"
---

# boundingBox(for:)

Calculates the bounding box around the characters in the range of a string.

## Declaration

```swift
@nonobjc func boundingBox(for range: Range<String.Index>) throws -> VNRectangleObservation?
```

## Parameters

- `range`: The range of the characters in the text string to draw a bounding box around.

## Return Value

Return Value A bounding box.

## Discussion

Discussion Bounding boxes aren’t always an exact fit around the characters. Use them to display in user interfaces to provide general guidance, but avoid using their contents for image processing. The bounding box that returns from this method differs based on the value of recognitionLevel, as follows:  |   |
