Advertisement
RRK

Presenting multiple ModalViews in ipad

RRK
Jun 5th, 2013
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //TestView
  2.  
  3. - (void)someFunction
  4. {
  5.  
  6.  
  7. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
  8.         {
  9.             AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  10.            TestViewController *test = [[TestViewController alloc]initWithNibName:@"TestViewController" bundle:nil];
  11.             moveNote.modalPresentationStyle = UIModalPresentationFormSheet;
  12.            
  13.             [appDelegate.splitViewController2 presentModalViewController:test animated:YES];
  14.             test.view.superview.bounds = CGRectMake(0, 0, 540, 350);//Dimensions of ModalView.
  15.          }
  16.  
  17. }
  18.  
  19. Y testViewController opens up, here I do this on click of a button
  20.  
  21. - (void)closeTest
  22. {
  23. [self dismissViewControllerAnimated:YES
  24.                                  completion:^{
  25.                                      
  26.                                      
  27.                                      EditViewController *editViewController = [[EditViewController alloc] initWithNibName:@"EditViewController" bundle:nil];
  28.                                      editViewController.modalPresentationStyle = UIModalPresentationFormSheet;
  29.                                      
  30.                                      [appDelegate.splitViewController2 presentModalViewController:editViewController animated:YES];
  31.                                      editViewController.view.superview.bounds = CGRectMake(0, 0, 540, 350);//Dimensions of ModalView.
  32.                                      editViewController.page = 3;              
  33.                                    
  34.                                      
  35.                                      //Call delegate function.
  36.                                  }];      
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement