When dismissing a view controller on top of a view controller with UIModalPresentationPageSheet or UIModalPresentationFormSheet, the presenting view controllers frame and transform can get miscomputed on iOS 7. Here is a fix I used in SPLSpeechBubblePopoverController:
@implementation UIViewController (SPLSpeechBubblePopoverControllerHack)
+ (void)load
{
class_swizzleSelector(self, @selector(dismissViewControllerAnimated:completion:), @selector(__SPLSpeechBubblePopoverControllerDismissViewControllerAnimated:completion:));
}
- (void)__SPLSpeechBubblePopoverControllerDismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
{
UIViewController *parentViewController = self;
while (parentViewController.parentViewController) {
parentViewController = parentViewController.parentViewController;
}
BOOL fuckedUpPresentationStyle = parentViewController.modalPresentationStyle == UIModalPresentationPageSheet || parentViewController.modalPresentationStyle == UIModalPresentationFormSheet;
BOOL transitionWillBeFuckedUp = fuckedUpPresentationStyle && [parentViewController.presentedViewController isKindOfClass:[SPLSpeechBubblePopoverController class]];
CGAffineTransform correctTransform = parentViewController.view.transform;
CGRect correctFrame = parentViewController.view.frame;
[self __SPLSpeechBubblePopoverControllerDismissViewControllerAnimated:flag completion:completion];
if (transitionWillBeFuckedUp) {
parentViewController.view.transform = correctTransform;
parentViewController.view.frame = correctFrame;
}
}
@end
this bug is valid only for iOS7.0 (fixed in iOS7.1)
Another fix may be presenting QuickLook in pageSheet style