Fix ASViewController accessing traitCollection on iOS 7 (#2259)

This commit is contained in:
Adlai Holler
2016-09-16 08:52:09 -07:00
committed by GitHub
parent 25de53bb13
commit 48f76c40d5

View File

@@ -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];