Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 1.55 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. masterView does not always show/hide properly
  2. -(void)viewDidLoad
  3. {
  4.     self.masterIsVisible = YES;
  5.     //a botton in navigation bar to hide or show the master view.
  6.     [button addTarget:self action:@selector(showOrHideMasterView)
  7.     forControlEventsTouchUpInside]
  8.     //gesture control to swipe right or left to slide master view in and out.
  9.     [swiperight addTarget:self action:@selector(showMasterView)];
  10.     [swipLeft addTarget:self action:@selector(hideMasterView)];
  11. }
  12.  
  13. -(void)showOrHideMasterView
  14. {
  15. if (self.masterIsVisible)
  16.     [self hidemasterView]; self.masterIsVisible = NO;
  17. else
  18.     [self showMasterView]; self.masterIsVisible = YES;
  19. }
  20.  
  21. -(void)hideMasterView
  22. {
  23.     //hides master view by substracting masterview's width from its origin.x
  24. }
  25.  
  26. -(void)showMasterView
  27. {
  28.     //shows master View by adding masterview's width to its origin.x
  29. }
  30. - (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:     (UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
  31. {
  32.     return NO;
  33. }
  34.        
  35. -(void)willAnimateRotationToInterfaceOrientation:
  36.   (UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
  37.  {
  38.  if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
  39.     self.masterIsVisible = NO;
  40.  else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
  41.     self.masterIsVisible = YES;
  42.  else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft)
  43.     self.masterIsVisible = YES;
  44.  else if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
  45.     self.masterIsVisible = NO;
  46.  }