As I see there's no such a simple solution.
But you still can do this.
The most evident is using timer to check when the wheel did scroll last time. I prefer using lightweight GCD-timers for this purposes (they also ARC-capable objects instead of NSTimer's which are storing strong
target-references).
- (void) scrollWheel:(NSEvent *)event
{
_lastStamp = mach_absolute_time(); // get current timestamp
if (!_running)
{
if (!_timer)
[self createTimerSource];
if (!_running)
dispatch_resume(_timer);
_running = YES;
}
}
- (void)createTimerSource
{
NSTimeInterval timeout = ...;
_timer=dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, _timerQueue);
dispatch_source_set_timer(_timer, DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC, 0);
// set the event handler
dispatch_source_set_event_handler(_timer, ^{
uint64_t stamp = mach_absolute_time(); // current stamp
if (stamp - _lastStamp > some_tolerance_value)
{
// wheel did end scroll
if (_running)
dispatch_source_cancel(_timer);
_running = NO;
}
});
}
Check the article out to know more about Dispatch Sources.