2

I am creating an external window to match its uiscreen size from a custom class that inherits from nsobject. It works however the rotation is wrong. It is rotated from various corners - depending on some unknown factor. In the view controller implementation of the custom class I added

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}
-(BOOL)shouldAutorotate
{
    return YES;
}

and the rotation happens on the external screen but the bounds are always wrong. It used to work previously but now not so much. How can I get the external screen to ignore device rotation and just be rotated properly to match the tv on the wall? Is that even the problem?

malaki1974
  • 1,605
  • 3
  • 16
  • 32

1 Answers1

0

A friend worked it out and this is his solution. Check the version of the os and handle if 8.3:

// Workaround for what seems like a bug in iOS 8.3
CGFloat magicAmount = (screenMode.size.width - screenMode.size.height) / 2;
_externalDisplayWindow.transform = CGAffineTransformTranslate(CGAffineTransformMakeRotation(-M_PI_2), -magicAmount, -magicAmount);
malaki1974
  • 1,605
  • 3
  • 16
  • 32