diff --git a/tns-core-modules/application/application.ios.ts b/tns-core-modules/application/application.ios.ts index b08dbabf4..867f2ef6f 100644 --- a/tns-core-modules/application/application.ios.ts +++ b/tns-core-modules/application/application.ios.ts @@ -21,9 +21,20 @@ import { Frame, NavigationEntry } from "../ui/frame"; import * as utils from "../utils/utils"; import { profile, level as profilingLevel, Level } from "../profiling"; -class Responder extends UIResponder { - // -} +// NOTE: UIResponder with implementation of window - related to https://github.com/NativeScript/ios-runtime/issues/430 +// TODO: Refactor the UIResponder to use Typescript extends when this issue is resolved: +// https://github.com/NativeScript/ios-runtime/issues/1012 +var Responder = (UIResponder).extend({ + get window() { + return iosApp ? iosApp.window : undefined; + }, + set window(setWindow) { + // NOOP + } +}, { + protocols: [UIApplicationDelegate] + } +); class NotificationObserver extends NSObject { private _onReceiveCallback: (notification: NSNotification) => void; @@ -150,7 +161,7 @@ class IOSApplication implements IOSApplicationDefinition { this.setWindowContent(args.root); } else { this._window = UIApplication.sharedApplication.delegate.window; - } + } } @profile @@ -368,4 +379,4 @@ global.__onLiveSync = function () { } livesync(); -} \ No newline at end of file +}