Introduce ASIndexedNodeContext

- It is a container object that holds enough information to construct and measure a cell node
- All information is gathered on main thread. This allows ASDataController to capture the correct state of its data source before going to background.
This commit is contained in:
Huy Nguyen
2016-02-29 00:54:36 -08:00
parent 3671f5cbc5
commit 54cde1a3db
6 changed files with 185 additions and 104 deletions

View File

@@ -0,0 +1,22 @@
//
// ASIndexedNodeContext.h
// AsyncDisplayKit
//
// Created by Huy Nguyen on 2/28/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import <AsyncDisplayKit/ASDataController.h>
#import <AsyncDisplayKit/ASDimension.h>
@interface ASIndexedNodeContext : NSObject
@property (nonatomic, readonly, strong) ASCellNodeBlock nodeBlock;
@property (nonatomic, readonly, assign) NSIndexPath *indexPath;
@property (nonatomic, readonly, assign) ASSizeRange constrainedSize;
- (instancetype)initWithNodeBlock:(ASCellNodeBlock)nodeBlock
indexPath:(NSIndexPath *)indexPath
constrainedSize:(ASSizeRange)constrainedSize;
@end