How can I find out whether my NSScrollView is currently scrolling? On iOS I can use the delegate but despite of googling a lot I can't find a way to do this on the Mac.
Thanks in advance!
You can receive notification NSViewBoundsDidChangeNotification like shown below
NSView *contentView = [scrollview contentView];
[contentView setPostsBoundsChangedNotifications:YES];
// a register for those notifications on the content view.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(boundDidChange:)
name:NSViewBoundsDidChangeNotification
object:contentView];
The notification method
- (void)boundDidChange:(NSNotification *)notification {
// get the changed content view from the notification
NSClipView *changedContentView=[notification object];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With