mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[ASCellNode] Apply layout delegate behavior in -__setNeedsLayout, not -setNeedsLayout
This commit is contained in:
@@ -34,6 +34,10 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
|
||||
|
||||
/**
|
||||
* Generic cell node. Subclass this instead of `ASDisplayNode` to use with `ASTableView` and `ASCollectionView`.
|
||||
|
||||
* @note When a cell node is contained inside a collection view (or table view),
|
||||
* calling `-setNeedsLayout` will also notify the collection on the main thread
|
||||
* so that the collection can update its item layout if the cell's size changed.
|
||||
*/
|
||||
@interface ASCellNode : ASDisplayNode
|
||||
|
||||
@@ -85,17 +89,6 @@ 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;
|
||||
|
||||
/**
|
||||
* Marks the node as needing layout. Convenience for use whether the view / layer is loaded or not.
|
||||
*
|
||||
* If this node was measured, calling this method triggers an internal relayout: the calculated layout is invalidated,
|
||||
* and the supernode is notified or (if this node is the root one) a full measurement pass is executed using the old constrained size.
|
||||
* The delegate will then be notified on main thread.
|
||||
*
|
||||
* This method can be called inside of an animation block (to animate all of the layout changes).
|
||||
*/
|
||||
- (void)setNeedsLayout;
|
||||
|
||||
/**
|
||||
* @abstract Initializes a cell with a given view controller block.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user