Improvements to the efficiency of recursivelySetInterfaceState: and the beta range controller.

This commit is contained in:
Scott Goodson
2016-01-10 02:33:34 -08:00
parent 03d13b19b0
commit 0feaa2a368
9 changed files with 103 additions and 47 deletions

View File

@@ -39,7 +39,6 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey";
if (!(self = [super init])) {
return nil;
}
_layoutChildren = [NSMutableDictionary dictionary];
_isMutable = YES;
return self;
}
@@ -56,11 +55,6 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey";
return self;
}
- (void)setChild:(id<ASLayoutable>)child;
{
[self setChild:child forIdentifier:kDefaultChildKey];
}
- (id<ASLayoutable>)layoutableToAddFromLayoutable:(id<ASLayoutable>)child
{
if (self.isFinalLayoutable == NO) {
@@ -88,6 +82,19 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey";
return child;
}
- (NSMutableDictionary *)layoutChildren
{
if (!_layoutChildren) {
_layoutChildren = [NSMutableDictionary dictionary];
}
return _layoutChildren;
}
- (void)setChild:(id<ASLayoutable>)child;
{
[self setChild:child forIdentifier:kDefaultChildKey];
}
- (void)setChild:(id<ASLayoutable>)child forIdentifier:(NSString *)identifier
{
ASDisplayNodeAssert(self.isMutable, @"Cannot set properties when layout spec is not mutable");