mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Fix ASViewController accessing traitCollection on iOS 7 (#2259)
This commit is contained in:
@@ -100,7 +100,12 @@
|
|||||||
// If not, we need to update the traits and propagate them.
|
// If not, we need to update the traits and propagate them.
|
||||||
if (CGSizeEqualToSize(self.node.environmentTraitCollection.containerSize, self.view.bounds.size) == NO) {
|
if (CGSizeEqualToSize(self.node.environmentTraitCollection.containerSize, self.view.bounds.size) == NO) {
|
||||||
[UIView performWithoutAnimation:^{
|
[UIView performWithoutAnimation:^{
|
||||||
ASEnvironmentTraitCollection environmentTraitCollection = [self environmentTraitCollectionForUITraitCollection:self.traitCollection];
|
ASEnvironmentTraitCollection environmentTraitCollection;
|
||||||
|
if (AS_AT_LEAST_IOS8) {
|
||||||
|
environmentTraitCollection = [self environmentTraitCollectionForUITraitCollection:self.traitCollection];
|
||||||
|
} else {
|
||||||
|
environmentTraitCollection = ASEnvironmentTraitCollectionMakeDefault();
|
||||||
|
}
|
||||||
environmentTraitCollection.containerSize = self.view.bounds.size;
|
environmentTraitCollection.containerSize = self.view.bounds.size;
|
||||||
// this method will call measure
|
// this method will call measure
|
||||||
[self progagateNewEnvironmentTraitCollection:environmentTraitCollection];
|
[self progagateNewEnvironmentTraitCollection:environmentTraitCollection];
|
||||||
|
|||||||
Reference in New Issue
Block a user