I have point a pageViewController
as the rootViewController
,and then I wanna display a login view above the pageViewController
if not sign in.
NLLoginViewController *loginVC = [[NLLoginViewController alloc]init];
UINavigationController *navigation = [[UINavigationController alloc]initWithRootViewController:loginVC];
[self.window addSubview:navigation.view];
You should do the following thing
self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
NLLoginViewController *loginVC = [[NLLoginViewController alloc]initWithNibName:@"NLLoginViewController" bundle:nil];
PageViewController *pageVC = [[PageViewController alloc]initWithNibName:@"PageViewController" bundle:nil];
UINavigationController *navigation
if(![[NSUserDefaults standardUserDefaults] boolForKey:@"is_SignedIn"]))
navigation = [[UINavigationController alloc]initWithRootViewController:logindVC];
else
navigation = [[UINavigationController alloc]initWithRootViewController:pageVC];
self.window.rootViewController = navigation;
After that In login view controller, you have to set
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"is_SignedIn"];