FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(ios delegate) Eliminate crash on selector looking for "Window" by NathanaelA · Pull Request #6428 · NativeScript/NativeScript · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
21 changes: 16 additions & 5 deletions tns-core-modules/application/application.ios.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (<any>UIResponder).extend({
get window() {
return iosApp ? iosApp.window : undefined;
},
set window(setWindow) {
// NOOP
}
}, {
protocols: [UIApplicationDelegate]
}
);

class NotificationObserver extends NSObject {
private _onReceiveCallback: (notification: NSNotification) => void;
Expand Down Expand Up @@ -150,7 +161,7 @@ class IOSApplication implements IOSApplicationDefinition {
this.setWindowContent(args.root);
} else {
this._window = UIApplication.sharedApplication.delegate.window;
}
}
}

@profile
Expand Down Expand Up @@ -368,4 +379,4 @@ global.__onLiveSync = function () {
}

livesync();
}
}

Back | FazBrowse Home | New Git URL