// // TailLoadingNode.m // Texture // // Copyright (c) Pinterest, Inc. All rights reserved. // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #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