mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Apply getter check to determine if API is exposed as property or as method for iOS backward compatibility
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user