[Layout] Improve Layout System Abstraction (#2941)

* Improve Layout Abstraction

* Address naming comments

- Rename ASPrimitiveTraitEnvironment to ASTraitEnvironment
- Rename ASPrimitiveTraitCollectionPropagateDown to ASTraitCollectionPropagateDown
- Rename progagateNewPrimitiveTraitCollection: to propagateNewTraitCollection:
This commit is contained in:
Michael Schneider
2017-02-03 13:04:20 -08:00
committed by GitHub
parent a2ff2b9900
commit 12e4e5b048
50 changed files with 725 additions and 831 deletions

View File

@@ -209,7 +209,7 @@
- (void)_populateSupplementaryNodesOfKind:(NSString *)kind withSections:(NSIndexSet *)sections mutableContexts:(NSMutableArray<ASIndexedNodeContext *> *)contexts
{
__weak id<ASEnvironment> environment = [self.environmentDelegate dataControllerEnvironment];
__weak id<ASTraitEnvironment> environment = [self.environmentDelegate dataControllerEnvironment];
[sections enumerateRangesUsingBlock:^(NSRange range, BOOL * _Nonnull stop) {
for (NSUInteger sec = range.location; sec < NSMaxRange(range); sec++) {
@@ -224,7 +224,7 @@
- (void)_populateSupplementaryNodesOfKind:(NSString *)kind atIndexPaths:(NSArray<NSIndexPath *> *)indexPaths mutableContexts:(NSMutableArray<ASIndexedNodeContext *> *)contexts
{
__weak id<ASEnvironment> environment = [self.environmentDelegate dataControllerEnvironment];
__weak id<ASTraitEnvironment> environment = [self.environmentDelegate dataControllerEnvironment];
NSMutableIndexSet *sections = [NSMutableIndexSet indexSet];
for (NSIndexPath *indexPath in indexPaths) {
@@ -242,7 +242,7 @@
}];
}
- (void)_populateSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath mutableContexts:(NSMutableArray<ASIndexedNodeContext *> *)contexts environment:(id<ASEnvironment>)environment
- (void)_populateSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath mutableContexts:(NSMutableArray<ASIndexedNodeContext *> *)contexts environment:(id<ASTraitEnvironment>)environment
{
ASCellNodeBlock supplementaryCellBlock;
if (_dataSourceImplementsSupplementaryNodeBlockOfKindAtIndexPath) {