mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Introduce ASCellNodeDelegate
- Cell node automatically notifies the delegate after a relayout (via -setNeedsLayout) that results in a new size. Confirming to ASCellNodeDelegate; ASTableView and ASCollectionView reload the calling cell upon notifications. These views automatically set themselves as delegate of every node. - The result is that ASCellNode subclasses don't need to manually notify the containing view. Thus, `-relayoutItemAtIndexPath` and `-relayoutRowAtIndexPath` are removed. - Kittens example is updated to reflect the change.
This commit is contained in:
@@ -559,14 +559,6 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Note: If the relayout causes a change in size of the root node that is attached to a container view,
|
||||
* the container view must be notified to relayout.
|
||||
* For ASTableView and ASCollectionView, instead of calling this method directly,
|
||||
* it is recommended to call -relayoutRowAtIndexPath:withRowAnimation and -relayoutItemAtIndexPath: respectively.
|
||||
*
|
||||
* @see [ASTableView relayoutRowAtIndexPath:withRowAnimation:]
|
||||
* @see [ASCollectionView relayoutItemAtIndexPath:]
|
||||
*/
|
||||
- (void)setNeedsLayout;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user