Contents

insertColumn(_:with:)

Inserts a new column of cells before the specified column, using the given cells.

Declaration

func insertColumn(_ column: Int, with newCells: [NSCell]?)

Parameters

  • column:

    The column at which to insert the new cells.

  • newCells:

    An array of objects to use to fill the new column, starting with the object at index 0. Each object should be an instance of Nscell or one of its subclasses (usually Nsactioncell).

Discussion

If column is greater than the number of columns in the receiver, enough columns are created to expand the receiver to be column columns wide. newCells should either be empty or contain a sufficient number of cells to fill each new column. If newCells is nil or an array with no elements, the call is equivalent to calling insertColumn(_:). Extra cells are ignored, unless the matrix is empty. In that case, a matrix is created with one column and enough rows for all the elements of newCells.

This method redraws the receiver. Your code may need to send sizeToCells() after sending this method to resize the receiver to fit the newly added cells.

See Also

Laying Out the Cells of the Matrix