I am detecting "all touches in an application" by overriding the sendEvent method in my UIApplication subclass. As part of this I've included a click debouncer that discards old events if the main thread gets clogged up somehow. Apple's own documentation says to compare it to NSProccessInfo.systemUptime. https://developer.apple.com/documentation/uikit/uievent/1613790-timestamp?language=objc
For an actual device this works just fine. But for the iOS simulator (iOS 15.4 simulator from Xcode 13.3) I'm getting some weird results where NSProcessInfo.systemUptime is 10's of thousands of seconds off. Anyone know what's causing this?
-(void)sendEvent:(UIEvent *)event {
NSTimeInterval eventTime = event.timestamp; // In simulator this ~= 6700
NSTimeInterval nowTime = NSProcessInfo.processInfo.systemUptime; // In simulator this ~= 280,000
// don't count old events, if possible (due to massive time discrepancies this if block is always hit in simulator
if(nowTime - eventTime > 50) {
[super sendEvent:event];
return;
}
// Do the actual thing I want to do
```
}