Guest User

Untitled

a guest
Jul 17th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. if(viewRotated)
  2. {
  3. subView.hidden = YES;
  4. }
  5. viewRotated = NO;
  6.  
  7. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  8. {
  9. if(UIInterfaceOrientationIsPortrait(interfaceOrientation))
  10. {
  11. [[NSNotificationCenter defaultCenter] addObserver:self
  12. selector:@selector(keyboardWillShow:)
  13. name:UIKeyboardWillShowNotification
  14. object:nil];
  15. [[NSNotificationCenter defaultCenter] addObserver:self
  16. selector:@selector(keyboardWillHide:)
  17. name:UIKeyboardWillShowNotification
  18. object:nil];
  19. }
  20. else
  21. {
  22.  
  23. [[NSNotificationCenter defaultCenter] removeObserver:self
  24. name:UIKeyboardWillShowNotification
  25. object:nil];
  26. [[NSNotificationCenter defaultCenter] removeObserver:self
  27. name:UIKeyboardWillShowNotification
  28. object:nil];
  29. }
  30. return YES;
  31. }
  32.  
  33. - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
Add Comment
Please, Sign In to add comment