---
title: "cell(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsgridview/cell(for:)"
---

# cell(for:)

Returns the grid cell object that contains the given view or one of its ancestors.

## Declaration

```swift
func cell(for view: NSView) -> NSGridCell?
```

## See Also

### Creating and Merging Cells

- [cell(atColumnIndex:rowIndex:)](appkit/nsgridview/cell(atcolumnindex:rowindex:).md)
- [mergeCells(inHorizontalRange:verticalRange:)](appkit/nsgridview/mergecells(inhorizontalrange:verticalrange:).md)
