---
title: "highlightNextResult(in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uifindsession/highlightnextresult(in:)"
---

# highlightNextResult(in:)

Updates the highlighted result to the next or previous match.

## Declaration

```swift
func highlightNextResult(in direction: UITextStorageDirection)
```

## Parameters

- `direction`: The direction, either forward or backward, to move through the search results.

## Discussion

Discussion The system calls this method when a person taps the next or previous button, or enters Return or Shift+Return on a hardware keyboard while the search field has focus.

## See Also

### Managing session interactions

- [performSearch(query:options:)](uikit/uifindsession/performsearch(query:options:).md)
- [performSingleReplacement(query:replacementString:options:)](uikit/uifindsession/performsinglereplacement(query:replacementstring:options:).md)
- [replaceAll(searchQuery:replacementString:options:)](uikit/uifindsession/replaceall(searchquery:replacementstring:options:).md)
- [invalidateFoundResults()](uikit/uifindsession/invalidatefoundresults().md)
