Tell the scroll by viewing the contents of the content to post changes to the changed notifications, then listen to NSViewBoundsDidChangeNotification.
[[aScrollView contentView] setPostsBoundsChangedNotifications:YES]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boundsDidChangeNotification:) name:NSViewBoundsDidChangeNotification object:[scrollView contentView]];
As indicated in the Scroll Programming Guide , you can get the current scroll position in this way:
NSPoint currentScrollPosition = [[theScrollView contentView] bounds].origin;
user155959
source share