I have an application that is configured via the plist file to support portrait, landscape left, and landscape right orientations (i.e. UISupportedInterfaceOrientations is set to UIInterfaceOrientationPortrait, UIInterfaceOrientationLandscapeLeft, and UIInterfaceOrientationLandscapeRight). But I've limited the supported orientations to just portrait inside of a view controller. If I present a UIActionSheet on the view controller's view and then rotate the device, the UIActionSheet rotates to the new orientation. This only happens on devices running iOS 8 (GM Seed).
I would like the UIActionSheet to follow the rules of the containing view controller and not rotate. Thoughts?
UIViewController Sample Code:
- (IBAction)onTouch:(id)sender
{
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:@"hi"
delegate:nil
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Open", nil];
[actionSheet showInView:self.view];
}
#pragma mark - Rotation methods
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}