---
title: "outlineView(_:nextTypeSelectMatchFromItem:toItem:for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsoutlineviewdelegate/outlineview(_:nexttypeselectmatchfromitem:toitem:for:)"
---

# outlineView(_:nextTypeSelectMatchFromItem:toItem:for:)

Returns the first item that matches the searchString from within the range of startItem to endItem

## Declaration

```swift
@MainActor optional func outlineView(_ outlineView: NSOutlineView, nextTypeSelectMatchFromItem startItem: Any, toItem endItem: Any, for searchString: String) -> Any?
```

## Parameters

- `outlineView`: The outline view that sent the message.
- `startItem`: The first item to search.
- `endItem`: The item before which to stop searching. It is possible for endItem to be less than startItem if the search will wrap.
- `searchString`: The string for which to search.

## Return Value

Return Value The first item—from within the range of startItem to endItem—that matches the searchString, or nil if there is no match.

## Discussion

Discussion Implement this method if you want to control how type selection works.  You should include startItem as a possible match, but do not include endItem. It is not necessary to implement this method in order to support type select.

## See Also

### Supporting Type Select

- [outlineView(_:typeSelectStringFor:item:)](appkit/nsoutlineviewdelegate/outlineview(_:typeselectstringfor:item:).md)
- [outlineView(_:shouldTypeSelectFor:withCurrentSearch:)](appkit/nsoutlineviewdelegate/outlineview(_:shouldtypeselectfor:withcurrentsearch:).md)
