Move Last Few Properties from ASTableView,ASCollectionView to Node (#225)

* Finish moving properties ASTableView->ASTableNode, ASCollectionView->ASCollectionNode

* Update changeling
This commit is contained in:
Adlai Holler
2017-05-04 05:41:58 -07:00
committed by Huy Nguyen
parent 25da46c8ac
commit 588f30c7dd
12 changed files with 266 additions and 69 deletions

View File

@@ -36,13 +36,6 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Asynchronous UICollectionView with Intelligent Preloading capabilities.
*
* @discussion ASCollectionView is a true subclass of UICollectionView, meaning it is pointer-compatible
* with code that currently uses UICollectionView.
*
* The main difference is that asyncDataSource expects -nodeForItemAtIndexPath, an ASCellNode, and
* the sizeForItemAtIndexPath: method is eliminated (as are the performance problems caused by it).
* This is made possible because ASCellNodes can calculate their own size, and preload ahead of time.
*
* @note ASCollectionNode is strongly recommended over ASCollectionView. This class exists for adoption convenience.
*/
@interface ASCollectionView : UICollectionView
@@ -54,25 +47,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, weak, readonly) ASCollectionNode *collectionNode;
/**
* The number of screens left to scroll before the delegate -collectionView:beginBatchFetchingWithContext: is called.
*
* Defaults to two screenfuls.
*/
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
/**
* Optional introspection object for the collection view's layout.
*
* @discussion Since supplementary and decoration views are controlled by the collection view's layout, this object
* is used as a bridge to provide information to the internal data controller about the existence of these views and
* their associated index paths. For collection views using `UICollectionViewFlowLayout`, a default inspector
* implementation `ASCollectionViewFlowLayoutInspector` is created and set on this property by default. Custom
* collection view layout subclasses will need to provide their own implementation of an inspector object for their
* supplementary views to be compatible with `ASCollectionView`'s supplementary node support.
*/
@property (nonatomic, weak) id<ASCollectionViewLayoutInspecting> layoutInspector;
/**
* Retrieves the node for the item at the given index path.
*
@@ -115,28 +89,47 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable id<ASSectionContext>)contextForSection:(NSInteger)section AS_WARN_UNUSED_RESULT;
@end
@interface ASCollectionView (Deprecated)
/*
* A Boolean value that determines whether the nodes that the data source renders will be flipped.
*/
@property (nonatomic, assign) BOOL inverted ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
/**
* The number of screens left to scroll before the delegate -collectionView:beginBatchFetchingWithContext: is called.
*
* Defaults to two screenfuls.
*/
@property (nonatomic, assign) CGFloat leadingScreensForBatching ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
/**
* Optional introspection object for the collection view's layout.
*
* @discussion Since supplementary and decoration views are controlled by the collection view's layout, this object
* is used as a bridge to provide information to the internal data controller about the existence of these views and
* their associated index paths. For collection views using `UICollectionViewFlowLayout`, a default inspector
* implementation `ASCollectionViewFlowLayoutInspector` is created and set on this property by default. Custom
* collection view layout subclasses will need to provide their own implementation of an inspector object for their
* supplementary views to be compatible with `ASCollectionView`'s supplementary node support.
*/
@property (nonatomic, weak) id<ASCollectionViewLayoutInspecting> layoutInspector ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
/**
* Determines collection view's current scroll direction. Supports 2-axis collection views.
*
* @return a bitmask of ASScrollDirection values.
*/
@property (nonatomic, readonly) ASScrollDirection scrollDirection;
@property (nonatomic, readonly) ASScrollDirection scrollDirection ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
/**
* Determines collection view's scrollable directions.
*
* @return a bitmask of ASScrollDirection values.
*/
@property (nonatomic, readonly) ASScrollDirection scrollableDirections;
/*
* A Boolean value that determines whether the nodes that the data source renders will be flipped.
*/
@property (nonatomic, assign) BOOL inverted;
@end
@interface ASCollectionView (Deprecated)
@property (nonatomic, readonly) ASScrollDirection scrollableDirections ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
/**
* Forces the .contentInset to be UIEdgeInsetsZero.