Rotate presented view and lock the orientation of presenting view controller

Viewed 970

I am working on iPad application which supports only landscape orientation, i want to allow some presented view controller to support all orientation without changing orientation of presenting view controller. Am supporting all orientation in Xcode Settings except upside down.

Code i am using to present view controller

    ViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"VC"];
    vc.modalPresentationStyle = UIModalPresentationFormSheet;
    [self presentViewController:vc animated:YES completion:nil];

Code i am using to allowing orientation for presented view controller:

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
    return YES;
}

You tube app provide same kind of feature while playing video, any idea how it is working?

Any help will appreciate, thanks.

2 Answers
Related