---
title: "searchTextRect(forBounds:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nssearchfieldcell/searchtextrect(forbounds:)"
---

# searchTextRect(forBounds:)

Modifies the bounding rectangle for the search-text field cell.

## Declaration

```swift
func searchTextRect(forBounds rect: NSRect) -> NSRect
```

## Parameters

- `rect`: The current bounding rectangle for the search text field.

## Return Value

Return Value The updated bounding rectangle to use for the search text field. The default value is the value passed into the rect parameter.

## Discussion

Discussion Subclasses can override this method to return a new bounding rectangle for the text-field cell object. You might use this method to provide a custom layout for the search field control.

## See Also

### Custom layout

- [searchButtonRect(forBounds:)](appkit/nssearchfieldcell/searchbuttonrect(forbounds:).md)
- [cancelButtonRect(forBounds:)](appkit/nssearchfieldcell/cancelbuttonrect(forbounds:).md)
