Apply getter check to determine if API is exposed as property or as method for iOS backward compatibility

This commit is contained in:
Panayot Cankov
2016-09-12 12:54:38 +03:00
parent f1f28745a8
commit e895f37f0b
29 changed files with 174 additions and 113 deletions

View File

@@ -1,5 +1,7 @@
import definition = require("fps-meter/fps-native");
import * as utils from "utils/utils";
class FrameHandlerImpl extends NSObject {
private _owner: WeakRef<FPSCallback>;
@@ -35,10 +37,10 @@ export class FPSCallback implements definition.FPSCallback {
this.displayLink = CADisplayLink.displayLinkWithTargetSelector(this.impl, "handleFrame");
this.displayLink.paused = true;
this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), NSDefaultRunLoopMode);
this.displayLink.addToRunLoopForMode(utils.ios.getter(NSRunLoop, 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);
this.displayLink.addToRunLoopForMode(utils.ios.getter(NSRunLoop, NSRunLoop.currentRunLoop), UITrackingRunLoopMode);
}
public start() {