I am trying to implement an application with a number of viewcontrollers presented through a hierarchy with different viewing on the iPad and Airplay device. I am using objective C and Storyboard.
I have updated the app delegate and I can see my first controller presented on both displays but then I get stuck when I push through the next view controllers. The iPad shows the next controllers but the Airplay gets stuck on the first one.
Does anyone have experience in building such an app and would be willing to share some lights on how to do this ?
This is my code snippet in my appdelegate:
//Managing connection and disconnection of screens. -(void) screenConnectionStatusChanged {
if ([[UIScreen screens] count] == 1) {
secondaryWindow.hidden=YES;
secondaryWindow.rootViewController = nil;
} else {
UIScreen *newScreen = [[UIScreen screens] lastObject];
self.secondaryWindow = [[UIWindow alloc] initWithFrame:[newScreen bounds]];
self.secondaryWindow.screen = newScreen;
self.secondaryWindow.hidden = NO;
self.secondaryWindow.layer.contentsGravity = kCAGravityResizeAspect;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
LoginViewController *vc = [storyboard instantiateInitialViewController];
[secondaryWindow setRootViewController:vc];
[secondaryWindow setHidden:NO];
[secondaryWindow makeKeyAndVisible];
}
}
Thanks