forked from TextureGroup/Texture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeedHeaderNode.m
More file actions
35 lines (28 loc) · 892 Bytes
/
Copy pathFeedHeaderNode.m
File metadata and controls
35 lines (28 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// 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