ios - Can [self.window makeKeyAndVisible]; be called before setting rootviewcontroller -
my requirement uitabbarcontroller rootviewcontroller , on first time of app launch want show login procedure inside uinavcon, , displaying through presentviewcontroller
.
i dont want uitabbarcontroller visible first time , dont want how login uinavcon popping modal.
i want make user experience if app starts first time login uinavcon should visible. here code:
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; [self.window makekeyandvisible];//is correct call here? loginvc *loginobj = [[loginvc alloc]init]; self.navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:cellphonenumber]; self.tabbarcontroller = [[uitabbarcontroller alloc]init]; self.window.rootviewcontroller = self.tabbarcontroller; [self.tabbarcontroller presentviewcontroller:self.navigationcontroller animated:no completion:^{}]; return yes; }
i calling [self.window makekeyandvisible];
on second line right after uiwindow
alloc
init
. correct or can experience problems viewcontroller not receiving events or orientations notifications?
you can call whenever want. calling affects window's z-index , screen property. doesnt depend on specific content being set.
Comments
Post a Comment