mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[ASCellNode] Layout delegate should not be public as it must not be reset externally.
Do not call layout delegate method before the cell node is loaded. This can happen if application code calls -setNeedsLayout on the cell manually, and can confuse UIKit state because we submit an empty batch update call on the next runloop.
This commit is contained in:
@@ -14,19 +14,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NSUInteger ASCellNodeAnimation;
|
||||
|
||||
@protocol ASCellNodeLayoutDelegate <NSObject>
|
||||
|
||||
/**
|
||||
* Notifies the delegate that the specified cell node has done a relayout.
|
||||
* The notification is done on main thread.
|
||||
*
|
||||
* @param node A node informing the delegate about the relayout.
|
||||
* @param sizeChanged `YES` if the node's `calculatedSize` changed during the relayout, `NO` otherwise.
|
||||
*/
|
||||
- (void)nodeDidRelayout:(ASCellNode *)node sizeChanged:(BOOL)sizeChanged;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* Generic cell node. Subclass this instead of `ASDisplayNode` to use with `ASTableView` and `ASCollectionView`.
|
||||
*/
|
||||
@@ -71,11 +58,6 @@ typedef NSUInteger ASCellNodeAnimation;
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL highlighted;
|
||||
|
||||
/*
|
||||
* A delegate to be notified (on main thread) after a relayout.
|
||||
*/
|
||||
@property (nonatomic, weak) id<ASCellNodeLayoutDelegate> layoutDelegate;
|
||||
|
||||
/*
|
||||
* ASCellNode must forward touch events in order for UITableView and UICollectionView tap handling to work. Overriding
|
||||
* these methods (e.g. for highlighting) requires the super method be called.
|
||||
|
||||
Reference in New Issue
Block a user