0

I am working on a iPAD application with MasterDetailView. From my tableView I am pushing another ViewController on detailViewController. I want this another ViewController to be displayed in landscape mode.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [_detailViewController.navigationController pushViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"ABCViewController"]  animated:YES];
}

I want this ABCViewController to be displayed in Landscape only view. All my other view supports both the orientation. Any help would be highly appreciated.

David Berry
  • 40,941
  • 12
  • 84
  • 95

1 Answers1

0

Insert in this new viewController:

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    //Choose your available orientation, you can also support more tipe using the symbol |
    //e.g. return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight)
    return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight);
}

as i already written here:

Disabling rotation for current screen?

Community
  • 1
  • 1
Matteo Gobbi
  • 17,697
  • 3
  • 27
  • 41