forked from TextureGroup/Texture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTailLoadingNode.m
More file actions
35 lines (29 loc) · 939 Bytes
/
Copy pathTailLoadingNode.m
File metadata and controls
35 lines (29 loc) · 939 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
//
// TailLoadingNode.m
// Sample
//
// Created by Adlai Holler on 1/3/17.
// Copyright © 2017 Facebook. All rights reserved.
//
#import "TailLoadingNode.h"
@interface TailLoadingNode ()
@property (nonatomic, strong) ASDisplayNode *activityIndicatorNode;
@end
@implementation TailLoadingNode
- (instancetype)init
{
if (self = [super init]) {
_activityIndicatorNode = [[ASDisplayNode alloc] initWithViewBlock:^{
UIActivityIndicatorView *v = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[v startAnimating];
return v;
}];
self.style.height = ASDimensionMake(100);
}
return self;
}
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
{
return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY sizingOptions:ASCenterLayoutSpecSizingOptionMinimumXY child:self.activityIndicatorNode];
}
@end