LGScrollingPerformanceMonitor
A UIScrollView FPS (Frames Per Second) Calculator
Demo
Usage
Drag LGScrollingPerformanceMonitor.h
and LGScrollingPerformanceMonitor.m
to your project. Observe the averageFPS
key like this:
[self.tableView addObserver:self forKeyPath:@"averageFPS" options:NSKeyValueObservingOptionNew context:NULL];
and then in the NSKeyValueObserving
call back get the FPS:
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (object == self.tableView && [keyPath isEqualToString:@"averageFPS"]) {
NSNumber *number = [change valueForKey:NSKeyValueChangeNewKey];
// Do whatever you want with the FPS
}
}