typo and comment

This commit is contained in:
rcancro
2016-05-11 14:08:06 -07:00
parent 4b54144f55
commit cfa9dcda56
3 changed files with 9 additions and 5 deletions

View File

@@ -52,6 +52,10 @@
- (void)dealloc
{
if (_traitColectionContext != nil) {
// The setter will iterate through the VC's subnodes and replace the traitCollectionContext in their ASEnvironmentTraitCollection with nil.
// Since the VC holds the only strong reference to this context and we are in the process of destroying
// the VC, all the references in the subnodes will be unsafe unless we nil them out. More than likely all the subnodes will be dealloc'ed
// as part of the VC being dealloc'ed, but this is just to make extra sure.
self.traitColectionContext = nil;
}
}
@@ -158,7 +162,7 @@
{
if (self.overrideDisplayTraitsWithTraitCollection) {
ASTraitCollection *asyncTraitCollection = self.overrideDisplayTraitsWithTraitCollection(traitCollection);
self.traitColectionContext = asyncTraitCollection.traitColectionContext;
self.traitColectionContext = asyncTraitCollection.traitCollectionContext;
return [asyncTraitCollection environmentTraitCollection];
}
@@ -171,7 +175,7 @@
{
if (self.overrideDisplayTraitsWithWindowSize) {
ASTraitCollection *traitCollection = self.overrideDisplayTraitsWithWindowSize(windowSize);
self.traitColectionContext = traitCollection.traitColectionContext;
self.traitColectionContext = traitCollection.traitCollectionContext;
return [traitCollection environmentTraitCollection];
}
return self.node.environmentTraitCollection;

View File

@@ -32,7 +32,7 @@
* This makes sure that the VC is the owner of the context and ASEnvironmentTraitCollections will not
* have a reference to a dangling pointer.
*/
@property (nonatomic, strong, readonly) id traitColectionContext;
@property (nonatomic, strong, readonly) id traitCollectionContext;
+ (ASTraitCollection *)traitCollectionWithASEnvironmentTraitCollection:(ASEnvironmentTraitCollection)traits;

View File

@@ -26,7 +26,7 @@
_horizontalSizeClass = horizontalSizeClass;
_verticalSizeClass = verticalSizeClass;
_forceTouchCapability = forceTouchCapability;
_traitColectionContext = traitCollectionContext;
_traitCollectionContext = traitCollectionContext;
}
return self;
}
@@ -91,7 +91,7 @@
.userInterfaceIdiom = self.userInterfaceIdiom,
.verticalSizeClass = self.verticalSizeClass,
.forceTouchCapability = self.forceTouchCapability,
.displayContext = self.traitColectionContext,
.displayContext = self.traitCollectionContext,
};
}