| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…r the delegate.window...
|
Hi and thanks for the PR! The team have been quite busy baking the upcoming NativeScript 5.0 release. We hope you love it as much as we do! The major release is the reason we taking longer with PR reviews. We will resume active reviewing in the following weeks. Thanks for your patience and for being awesome contributor! |
Sorry, something went wrong.
| // | ||
| } | ||
| // Must use .extend() to make the "window" be a valid iOS selector | ||
| var Responder = UIResponder.extend({ |
There was a problem hiding this comment.
Can you refactor this code to use TypeScript extend. It will be more like the rest of the codebase. Should look something like:
class Responder extends UIResponder implements UIApplicationDelegate {
public static ObjCProtocols = [UIApplicationDelegate];
private _window: UIWindow;
get window(): UIWindow {
return this._window;
}
set window(setWindow: UIWindow) {
this._window = setWindow;
}
}
Sorry, something went wrong.
There was a problem hiding this comment.
@vakrilov It's true - the standard TypeScript version does cause issues due to what @mbektchiev points out in that issue - recently ran into that and was surprised as well. His suggestion there to use .extend works great though.
Sorry, something went wrong.
There was a problem hiding this comment.
I guess that the reason is related to another issue we recently discovered in the runtime: NativeScript/ios-jsc#1012. My guess is that if you implement the methods with 2 functions named window and setWindow they should be correctly callable from native.
Sorry, something went wrong.
|
Thanks for the PR! get window(): UIWindow {
return iosApp ? iosApp.window : undefined;
}
Not sure if the setter should do anything - probably not. |
Sorry, something went wrong.
|
Hey @NathanaelA |
Sorry, something went wrong.
|
test |
Sorry, something went wrong.
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Checklist
What is the current behavior?
NS Will crash on some plugins when they attempt to get the "window" from the main delegate. With the error message Application terminated which can't be caught.
What is the new behavior?
NS won't crash anymore
Fixes/Implements/Closes # NativeScript/ios-jsc#430
Notes:
I am not 100% sure if I need to return a valid window, or if undefined is enough. If you believe I should pre-set the window, I'm willing to update the PR if you can point me at which of our "windows" we should return. However, in the plugin I was converting -- I just had to have a valid selector; once I had a property the selector could access; all the random crashes about the missing selector stopped, even though the plugin was always getting "undefined" as the result back. Having the selector was all that is needed to fix this issue for the plugin I was working on making work in NS.