---
title: "topCandidates(_:)"
framework: vision
role: symbol
role_heading: Instance Method
path: "vision/vnrecognizedtextobservation/topcandidates(_:)"
---

# topCandidates(_:)

Requests the n top candidates for a recognized text string.

## Declaration

```swift
func topCandidates(_ maxCandidateCount: Int) -> [VNRecognizedText]
```

## Parameters

- `maxCandidateCount`: The maximum number of candidates to return. This can’t exceed 10.

## Return Value

Return Value An array of the n top candidates, sorted by decreasing confidence score.

## Discussion

Discussion This function returns no more than n candidates, but it may return fewer than n candidates.

## See Also

### Obtaining Recognized Text

- [VNRecognizedText](vision/vnrecognizedtext.md)
