Search code examples
iosuiscrollviewtransformuiwindow

UIScrollView dragging affected by UIWindow transform rotation


I'm adding a video out function to my iPad app and have run into a problem with my UIScrollView. To get the proper view orientation on the external monitor, I've rotated the UIWindow based on the current interface orientation (e.g. - mirroredScreenWindow.transform = CGAffineTransformMakeRotation(- M_PI * 0.5);).

The problem I've run into is that the ScrollView dragging seems to be affected by the UIWindow transform. If the UIWindow is rotated 90 degrees, horizontal drags scroll the view vertically and vice versa. Is there any way to correct this?


Solution

  • I got a response from Apple Dev Support that said essentially, "Doing a transform on UIWindow will confuse the internal objects and should never be done."

    Looks like I'll just have to create a modified ViewController that lays out all of my UI elements specifically for the format of the external screen, rather than just transforming the view controller that already works correctly on the iPad screen.