mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
code fixed to work in viewDidLoad
This commit is contained in:
@ -283,11 +283,16 @@ typedExports.start = function (entry?: NavigationEntry) {
|
|||||||
let rootView = createRootView();
|
let rootView = createRootView();
|
||||||
if(rootView) {
|
if(rootView) {
|
||||||
// Attach to the existing iOS app
|
// Attach to the existing iOS app
|
||||||
let rootController = iosApp.nativeApp.keyWindow.rootViewController;
|
var window = iosApp.nativeApp.keyWindow || (iosApp.nativeApp.windows.count > 0 && iosApp.nativeApp.windows[0]);
|
||||||
|
if(window) {
|
||||||
|
var rootController = window.rootViewController;
|
||||||
|
if(rootController) {
|
||||||
rootController.presentViewControllerAnimatedCompletion(rootView.ios.controller, utils.ios.MajorVersion >= 7, null);
|
rootController.presentViewControllerAnimatedCompletion(rootView.ios.controller, utils.ios.MajorVersion >= 7, null);
|
||||||
uiUtils.ios._layoutRootView(rootView, utils.ios.getter(UIScreen, UIScreen.mainScreen).bounds);
|
uiUtils.ios._layoutRootView(rootView, utils.ios.getter(UIScreen, UIScreen.mainScreen).bounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error("iOS Application already started!");
|
throw new Error("iOS Application already started!");
|
||||||
|
Reference in New Issue
Block a user