[ASRangeController] Initial implementation of functional-style, ASInterfaceState-based range controller.

This commit is contained in:
Scott Goodson
2016-01-01 00:48:44 -08:00
parent 7a9cd1f930
commit b273f358f5
26 changed files with 382 additions and 187 deletions

View File

@@ -42,6 +42,37 @@
CGColorSpaceRelease(colorSpace);
}
- (instancetype)init
{
if (!(self = [super init])) {
return nil;
}
_indexPathTextNode = [[ASTextNode alloc] init];
[self addSubnode:_indexPathTextNode];
return self;
}
- (void)setIndexPath:(NSIndexPath *)indexPath
{
_indexPath = indexPath;
_indexPathTextNode.attributedString = [[NSAttributedString alloc] initWithString:[indexPath description] attributes:nil];
}
//- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
//{
// ASStackLayoutSpec *stackSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical spacing:0 justifyContent:ASStackLayoutJustifyContentStart alignItems:ASStackLayoutAlignItemsStart children:@[_indexPathTextNode]];
// stackSpec.flexGrow = YES;
// return stackSpec;
//}
- (void)layout
{
_indexPathTextNode.frame = self.bounds;
[super layout];
}
#if 0
- (void)fetchData
{