boundingBox(for:)
Calculates the bounding box around the characters in the range of a string.
Declaration
@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
A bounding box.
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:
The bounding box has character precision. When you specify a range from | |
|---|---|
The bounding box has word precision. When you specify a range from |