code fixed to work in viewDidLoad

This commit is contained in:
Vladimir Enchev
2016-10-14 10:02:35 +03:00
parent c521f2db33
commit b398f27586

View File

@ -283,9 +283,14 @@ 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]);
rootController.presentViewControllerAnimatedCompletion(rootView.ios.controller, utils.ios.MajorVersion >= 7, null); if(window) {
uiUtils.ios._layoutRootView(rootView, utils.ios.getter(UIScreen, UIScreen.mainScreen).bounds); var rootController = window.rootViewController;
if(rootController) {
rootController.presentViewControllerAnimatedCompletion(rootView.ios.controller, utils.ios.MajorVersion >= 7, null);
uiUtils.ios._layoutRootView(rootView, utils.ios.getter(UIScreen, UIScreen.mainScreen).bounds);
}
}
} }
} }