FPS module will now correctly count frames while scrolling in iOS

This commit is contained in:
Panayot Cankov
2015-07-07 18:01:43 +03:00
parent c2288c5332
commit 1d39b99066

View File

@ -35,6 +35,9 @@ export class FPSCallback implements definition.FPSCallback {
this.displayLink = CADisplayLink.displayLinkWithTargetSelector(this.impl, "handleFrame"); this.displayLink = CADisplayLink.displayLinkWithTargetSelector(this.impl, "handleFrame");
this.displayLink.paused = true; this.displayLink.paused = true;
this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), NSDefaultRunLoopMode); 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() { public start() {