Swiftgram/examples/ASDKgram/Sample/FeedHeaderNode.m
Adlai Holler 38aac9d019 IGListKit Support II: Electric Boogaloo (#2942)
* Reimplement IGListKit support in a cleaner way

* Rename and fix some stuff

* Fix supplementaries more

* Update docs

* Update test

* Cleanup minor things

* Tweak it

* Indentation

* Remove irrelevant changes

* Break out cell into its own file

* Fix indentation

* Address feedback
2017-01-30 11:16:59 -08:00

36 lines
892 B
Objective-C

//
// FeedHeaderNode.m
// Sample
//
// Created by Adlai Holler on 1/23/17.
// Copyright © 2017 Facebook. All rights reserved.
//
#import "FeedHeaderNode.h"
#import "Utilities.h"
static UIEdgeInsets kFeedHeaderInset = { .top = 20, .bottom = 20, .left = 10, .right = 10 };
@interface FeedHeaderNode ()
@property (nonatomic, strong, readonly) ASTextNode *textNode;
@end
@implementation FeedHeaderNode
- (instancetype)init
{
if (self = [super init]) {
_textNode = [[ASTextNode alloc] init];
self.automaticallyManagesSubnodes = YES;
_textNode.attributedText = [NSAttributedString attributedStringWithString:@"Latest Posts" fontSize:18 color:[UIColor darkGrayColor] firstWordColor:nil];
}
return self;
}
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
{
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:kFeedHeaderInset child:_textNode];
}
@end