Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UIInterfaceOrientationMask)supportedInterfaceOrientations
- {
- if ([self.currentViewController isEqual:self.viewControllerYouDontWantToRotate])
- {
- return UIInterfaceOrientationMaskPortrait;
- }
- else
- {
- return UIInterfaceOrientationMaskAll;
- }
- }
- - (BOOL)shouldAutorotate
- {
- if ([self.currentViewController isEqual:self.viewControllerYouDontWantToRotate])
- {
- return NO;
- }
- else
- {
- return YES;
- }
- }
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
- {
- return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
- }
- - (void)rotateToLandscape{
- NSNumber *valueLandscape = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
- [[UIDevice currentDevice] setValue:valueLandscape forKey:@"orientation"];
- }
- - (void)rotateToPortrait{
- NSNumber *valuePortrait = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
- [[UIDevice currentDevice] setValue:valuePortrait forKey:@"orientation"];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement