mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-03-28 23:58:50 +08:00
Merge pull request #1766 from hannahmbanana/collectionLayout
[ASCollectionView, ASCellNode] Add support applyLayoutAttributes: on ASCellNode
This commit is contained in:
@@ -99,6 +99,13 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
|
||||
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
|
||||
- (void)touchesCancelled:(nullable NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
|
||||
|
||||
/**
|
||||
* Called by the system when ASCellNode is used with an ASCollectionNode. It will not be called by ASTableNode.
|
||||
* When the UICollectionViewLayout object returns a new UICollectionViewLayoutAttributes object, the corresponding ASCellNode will be updated.
|
||||
* See UICollectionViewCell's applyLayoutAttributes: for a full description.
|
||||
*/
|
||||
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes;
|
||||
|
||||
/**
|
||||
* @abstract Initializes a cell with a given view controller block.
|
||||
*
|
||||
|
||||
@@ -211,6 +211,11 @@
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
|
||||
{
|
||||
// To be overriden by subclasses
|
||||
}
|
||||
|
||||
- (void)cellNodeVisibilityEvent:(ASCellNodeVisibilityEvent)event inScrollView:(UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame
|
||||
{
|
||||
// To be overriden by subclasses
|
||||
|
||||
@@ -58,6 +58,11 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
||||
_node.highlighted = highlighted;
|
||||
}
|
||||
|
||||
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
|
||||
{
|
||||
[_node applyLayoutAttributes:layoutAttributes];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
Reference in New Issue
Block a user