Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this method will change the current view to next view
- - (IBAction)startButtonPressed:(id)sender
- {
- //next view controllers
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- tutorialViewController = [[TutorialViewController alloc]initWithNibName:@"TutorialView_iPad" bundle:nil];
- notesViewController = [[NoteViewController alloc]initWithNibName:@"NoteView_iPad" bundle:nil];
- }
- else {
- tutorialViewController = [[TutorialViewController alloc]initWithNibName:@"TutorialView" bundle:nil];
- notesViewController = [[NoteViewController alloc]initWithNibName:@"NoteView" bundle:nil];
- }
- tutorialViewController.title = @"Index";
- //navigation logic
- UINavigationController *tutorialNavigation = [[[UINavigationController alloc]initWithRootViewController:tutorialViewController ]autorelease];
- tutorialNavigation.navigationBar.tintColor = [UIColor blackColor];
- notesViewController.title = @"Notes";
- UINavigationController *notesNavigation = [[[UINavigationController alloc]initWithRootViewController:notesViewController]autorelease];
- notesNavigation.navigationBar.tintColor = [UIColor blackColor];
- //adding view controllers to tab bar controller with navigation controller
- tabBarController = [[UITabBarController alloc]initWithNibName:nil bundle:nil];
- tabBarController.viewControllers = [NSArray arrayWithObjects:tutorialNavigation,notesNavigation,nil];
- tabBarController.selectedViewController = tutorialNavigation;
- //flip animation
- tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
- [self presentModalViewController:tabBarController animated:YES];
- //[self presentViewController:tabBarController animated:YES completion:nil];
- }
Add Comment
Please, Sign In to add comment