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

@@ -83,6 +83,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (weak, nonatomic) id <ASCollectionDataSource> dataSource;
/**
* The number of screens left to scroll before the delegate -collectionNode:beginBatchFetchingWithContext: is called.
*
* Defaults to two screenfuls.
*/
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
/*
* A Boolean value that determines whether the collection node will be flipped.
* If the value of this property is YES, the first cell node will be at the bottom of the collection node (as opposed to the top by default). This is useful for chat/messaging apps. The default value is NO.
@@ -109,6 +116,18 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, strong) UICollectionViewLayout *collectionViewLayout;
/**
* Optional introspection object for the collection node's layout.
*
* @discussion Since supplementary and decoration nodes are controlled by the 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 collections using `UICollectionViewFlowLayout`, a default inspector
* implementation `ASCollectionViewFlowLayoutInspector` is created and set on this property by default. Custom
* collection layout subclasses will need to provide their own implementation of an inspector object for their
* supplementary elements to be compatible with `ASCollectionNode`'s supplementary node support.
*/
@property (nonatomic, weak) id<ASCollectionViewLayoutInspecting> layoutInspector;
/**
* Tuning parameters for a range type in full mode.
*
@@ -168,6 +187,20 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition animated:(BOOL)animated;
/**
* Determines collection node's current scroll direction. Supports 2-axis collection nodes.
*
* @return a bitmask of ASScrollDirection values.
*/
@property (nonatomic, readonly) ASScrollDirection scrollDirection;
/**
* Determines collection node's scrollable directions.
*
* @return a bitmask of ASScrollDirection values.
*/
@property (nonatomic, readonly) ASScrollDirection scrollableDirections;
#pragma mark - Editing
/**
@@ -745,7 +778,7 @@ NS_ASSUME_NONNULL_BEGIN
* 4. Lastly, you must implement a method to provide the size for the cell. There are two ways this is done:
* 4a. UICollectionViewFlowLayout (incl. ASPagerNode). Implement
collectionNode:constrainedSizeForItemAtIndexPath:.
* 4b. Custom collection layouts. Set .view.layoutInspector and have it implement
* 4b. Custom collection layouts. Set .layoutInspector and have it implement
collectionView:constrainedSizeForNodeAtIndexPath:.
*
* For an example of using this method with all steps above (including a custom layout, 4b.),