mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
globals module added with setTimeout implementation for both iOS and Android
This commit is contained in:
7
globals/globals.ios.ts
Normal file
7
globals/globals.ios.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* iOS specific global functions implementation.
|
||||
*/
|
||||
export function setTimeout(callback: Function, milliseconds: number): void {
|
||||
var target = Foundation.NSObject.extends({ tick: function (timer) { callback(); } }, { exposedMethods: { "tick:": "v@:@" } });
|
||||
Foundation.NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(milliseconds / 1000, new target(), "tick:", null, false);
|
||||
}
|
||||
Reference in New Issue
Block a user