0

I've tried using KVO on NSTableHeaderView.draggedDistance but didn't get anywhere - I might be incorrect but I assume because it is a computed property. NSTableView has .rect(ofColumn:) but as far as I'm aware this is also not something I can track. tableViewColumnDidMove(_ notification: Notification) only triggers once the column is released and func tableView(_ tableView: NSTableView, shouldReorderColumn columnIndex: Int, toColumn newColumnIndex: Int) -> Bool only runs when the column index changes positions (for instance, when column index 2 becomes column index 3), not while its position value (in points/pixels) changes. Any pointers?

Cherub
  • 17
  • 4
  • I think it's not possible. Hacky undocumented workaround: subclass `NSTableHeaderView` and override `draggedDistance` or `draggedColumn`. – Willeke Jul 11 '23 at 05:54
  • I tried that actually - but got an error when trying to override draggedDistance's setter as it doesn't have one (but I am interested in doing something when that value changes/is-being-set) – Cherub Jul 11 '23 at 09:30
  • 1
    `draggedDistance` is called repeatedly. – Willeke Jul 11 '23 at 10:58
  • Ah right, yes using the `get` seems to work. That'll solve my issue, thanks! – Cherub Jul 11 '23 at 11:32

0 Answers0