NSScrollView sticky headers

I'm trying to implement a data grid for macos. The first thing I need to achieve is to be able to have a NSScrollView with sticky/frozen headers, like excel, where there are column headers which only scroll horizontally and stay in the viewport when the user scrolls vertically, and similarly for row headers. In iOS I implemented it by moving the headers on scrolled event to counteract scrolling. But in macos the DidLiveScroll happens asynchronously and there is a constant trembling in the headers while scrolling.

What is the best way to have some frozen views in macos NSScrolView?

I suppose I could use 3 NSScrollViews (1 for the column headers, 1 for the row headers, and another for the content) and synchronize them, but I'm wondering whether there is a better/simpler way.


Alvaro.

NSScrollView sticky headers
 
 
Q