---
title: "titleRect(forBounds:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscell/titlerect(forbounds:)"
---

# titleRect(forBounds:)

Returns the rectangle in which the receiver draws its title text.

## Declaration

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

## Parameters

- `rect`: The bounding rectangle of the receiver.

## Return Value

Return Value The rectangle in which the receiver draws its title text.

## Discussion

Discussion If the receiver is a text-type cell, this method resizes the drawing rectangle for the title (theRect) inward by a small offset to accommodate the cell border. If the receiver is not a text-type cell, the method does nothing.

## See Also

### Determining Cell Size

- [calcDrawInfo(_:)](appkit/nscell/calcdrawinfo(_:).md)
- [cellSize](appkit/nscell/cellsize.md)
- [cellSize(forBounds:)](appkit/nscell/cellsize(forbounds:).md)
- [drawingRect(forBounds:)](appkit/nscell/drawingrect(forbounds:).md)
- [imageRect(forBounds:)](appkit/nscell/imagerect(forbounds:).md)
- [controlSize](appkit/nscell/controlsize.md)
