mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Check if a superview is present before calculating the legacy constrained size
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user