mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[ASRangeController] Initial implementation of functional-style, ASInterfaceState-based range controller.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user