This is needed because the subviews were added to the UIWindow and the normal orientation handling through the existing view hierarchy was lost. All those nested case statements are a little hard to read. Maybe this could be simplified?
Was this taken from https://github.com/myell0w/MTZoomWindow/blob/master/MTZoomWindow.m#L264?