globals module added with setTimeout implementation for both iOS and Android

This commit is contained in:
Vladimir Enchev
2014-05-10 13:15:37 +03:00
parent 44c51a0e48
commit 2d701fb5a4
7 changed files with 39 additions and 8 deletions

7
globals/globals.ios.ts Normal file
View 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);
}