0

Currently I'm using the below code to force orientation on a view controller to landscape.

NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
[UIViewController attemptRotationToDeviceOrientation];

This works fine in IOS 7.1 target simulator and on my IOS 7.1 device.

When attempting to use this for IOS 8.1, the simulator will physically rotate sideways but the view will stay portrait.

Is there any fix, or other way of rotating for this.

Inder Kumar Rathore
  • 39,458
  • 17
  • 135
  • 184
sneexz
  • 265
  • 2
  • 4
  • 10

1 Answers1

1

It is probably due to a line left over by xcode in your appDelegate.

The following answer contains the line you need to remove:

UISplitViewController rotation iOS8 not working as expected

Community
  • 1
  • 1
Rory McKinnel
  • 7,936
  • 2
  • 17
  • 28