---
title: sizeToCells()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsmatrix/sizetocells()
---

# sizeToCells()

Changes the width and the height of the receiver’s frame so it exactly contains the cells.

## Declaration

```swift
func sizeToCells()
```

## Discussion

Discussion This method does not redraw the receiver.

## See Also

### Related Documentation

- [setFrameSize(_:)](appkit/nsview/setframesize(_:).md)
- [sizeToFit()](appkit/nscontrol/sizetofit().md)

### Resizing the Matrix and Its Cells

- [autosizesCells](appkit/nsmatrix/autosizescells.md)
- [setValidateSize(_:)](appkit/nsmatrix/setvalidatesize(_:).md)
