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:
Huy Nguyen
2015-10-29 15:59:54 +02:00
parent cd31f884dd
commit 00400e166f
9 changed files with 84 additions and 49 deletions

View File

@@ -223,16 +223,6 @@
*/
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
/**
* Relayouts the specified item.
*
* @param indexPath The index path identifying the item to relayout.
*
* @discussion This method must be called from the main thread. The relayout is excuted on main thread.
* The node of the specified item must be updated to cause layout changes before this method is called.
*/
- (void)relayoutItemAtIndexPath:(NSIndexPath *)indexPath;
/**
* Moves the item at a specified location to a destination location.
*