Skip to content

Instantly share code, notes, and snippets.

Created June 22, 2012 12:17
Show Gist options
  • Select an option

  • Save anonymous/2972414 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/2972414 to your computer and use it in GitHub Desktop.
//rootViewController.h
//showLoginScreen function
PupilsViewControllerV2Pupils *pupil_selection = [[PupilsViewControllerV2Pupils alloc] init];
[pupil_selection setDelegate:self]; //makes the rootviewcontroller (self) listen for response from PupilsViewControllerV2Pupils
... //setup your UIViewController (PupilsViewControllerV2Pupils) here
//create UINavigationController to hold the loginView
UINavigationController *selection_controller = [[UINavigationController alloc] initWithRootViewController:pupil_selection];
//only want to call this if its an iPad... if its iPhone we let it use the standard appearance what takes the whole screen
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
[selection_controller setModalPresentationStyle:UIModalPresentationFormSheet];
[selection_controller setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
}
//present the view
[self presentModalViewController:selection_controller animated:YES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment