frameOfCell(atColumn:row:)
Returns a rectangle locating the cell that lies at the intersection of the specified column and row.
Declaration
func frameOfCell(atColumn column: Int, row: Int) -> NSRectParameters
- column:
The index in the Tablecolumns array of the column containing the cell whose rectangle you want.
- row:
The index of the row containing the cell whose rectangle you want.
Return Value
A rectangle locating the cell that lies at the intersection of columnIndex and rowIndex. This method returns NSZeroRect if columnIndex or rowIndex is greater than the number of columns or rows in the table view.
Discussion
You can use this method to update a single cell more efficiently than sending the table view a reloadData() message using reloadData(forRowIndexes:columnIndexes:)
The result of this method is used in a draw(withFrame:in:) message to the table column’s data cell. You can subclass and override this method to customize the frame of a particular cell. However, never return a frame larger than the default implementation returns.
The default frame is computed to have a height equal to the rect(ofRow:) for rowIndex, minus the half intercellSpacing height on the top and half on the bottom. The width of frame is equal to the with of the table column minus half the intercellSpacing width on the left, and half on the right.