SHARE
TWEET

Untitled

a guest Dec 10th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // this method will change the current view to next view
  2. - (IBAction)startButtonPressed:(id)sender
  3. {
  4.     //next view controllers
  5.     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
  6.         tutorialViewController = [[TutorialViewController alloc]initWithNibName:@"TutorialView_iPad" bundle:nil];
  7.         notesViewController = [[NoteViewController alloc]initWithNibName:@"NoteView_iPad" bundle:nil];
  8.     }
  9.     else {
  10.         tutorialViewController = [[TutorialViewController alloc]initWithNibName:@"TutorialView" bundle:nil];
  11.         notesViewController = [[NoteViewController alloc]initWithNibName:@"NoteView" bundle:nil];
  12.     }
  13.     tutorialViewController.title = @"Index";
  14.     //navigation logic
  15.     UINavigationController *tutorialNavigation = [[[UINavigationController alloc]initWithRootViewController:tutorialViewController ]autorelease];
  16.     tutorialNavigation.navigationBar.tintColor = [UIColor blackColor];
  17.     notesViewController.title = @"Notes";
  18.     UINavigationController *notesNavigation = [[[UINavigationController alloc]initWithRootViewController:notesViewController]autorelease];
  19.     notesNavigation.navigationBar.tintColor = [UIColor blackColor];
  20.     //adding view controllers to tab bar controller with navigation controller
  21.     tabBarController = [[UITabBarController alloc]initWithNibName:nil bundle:nil];
  22.     tabBarController.viewControllers = [NSArray arrayWithObjects:tutorialNavigation,notesNavigation,nil];
  23.     tabBarController.selectedViewController = tutorialNavigation;
  24.     //flip animation
  25.     tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
  26.     [self presentModalViewController:tabBarController animated:YES];
  27.     //[self presentViewController:tabBarController animated:YES completion:nil];
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top