There is a class ViewController, inherited from NSViewController, NSTableViewDataSource, NSTableViewDelegate. Each of the cells can its size. Implemented features such as

numberOfRowsInTableView(tableView: NSTableView) tableView(tableView: NSTableView, shouldSelectRow row: Int) tableView(tableView: NSTableView, heightOfRow row: Int) tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) tableViewColumnDidResize(notification: NSNotification) 

Is it possible, when resizing a control (calling the tableViewColumnDidResize function), to forcibly recalculate the sizes of each of the cells? A possible solution, TableView.reloadData() not suitable for other brakes, because there is a re-request information.

  • so request information from reload - Max Mikheyenko
  • @MaxMikheyenko You suggest to implement a separate reload, with the possibility of a full reload of information, and an option only with the miscalculation of sizes? - Rubikoid

1 answer 1

Ok, everything is solved easier. TableView has a noteHeightOfRowsWithIndexesChanged function. We TableView.rowsInRect(self.scrollView.contentView.bounds) for all visible lines through TableView.rowsInRect(self.scrollView.contentView.bounds) and give them to that function.

 func tableViewColumnDidResize(notification: NSNotification) { let visibleRows: NSRange = self.messageTableView.rowsInRect(self.scrollView.contentView.bounds) messageTableView.noteHeightOfRowsWithIndexesChanged(NSIndexSet(indexesInRange: visibleRows)) }