Check if a superview is present before calculating the legacy constrained size

This commit is contained in:
Michael Schneider
2016-07-08 13:20:18 -07:00
parent 057c48482a
commit 33e093b1f6

View File

@@ -203,7 +203,14 @@ ASVisibilityDepthImplementation;
{
// In modal presentation the view does not have the right bounds in iOS7 and iOS8. As workaround using the superviews
// view bounds
CGSize viewSize = (self.presentingViewController != nil) ? self.view.superview.bounds.size : self.view.bounds.size;
UIView *view = self.view;
CGSize viewSize = view.bounds.size;
if (self.presentingViewController != nil) {
UIView *superview = view.superview;
if (superview != nil) {
viewSize = superview.bounds.size;
}
}
return ASSizeRangeMake(viewSize, viewSize);
}