Merge pull request #405 from NativeScript/fps-count-while-scrolling

FPS module will now correctly count frames while scrolling in iOS
This commit is contained in:
dtopuzov
2015-07-13 09:58:56 +03:00

View File

@ -35,6 +35,9 @@ export class FPSCallback implements definition.FPSCallback {
this.displayLink = CADisplayLink.displayLinkWithTargetSelector(this.impl, "handleFrame");
this.displayLink.paused = true;
this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), NSDefaultRunLoopMode);
// UIScrollView (including in UIITableView) will run a loop in UITrackingRunLoopMode during scrolling.
// If we do not add the CADisplayLink in this mode, it would appear paused during scrolling.
this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), UITrackingRunLoopMode);
}
public start() {