mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
- Support internal relayout, that is a relayout caused by internal layout changes, like subnodes re-arrangement and/or subnodes' size change. The constrained size applied to root node is unchanged.
- Update Kittens example to show how internal relayout is done.
This commit is contained in:
@@ -102,6 +102,16 @@ static const NSInteger kMaxLitterSize = 100; // max number of kitten cell
|
||||
#pragma mark -
|
||||
#pragma mark ASTableView.
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
[_tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
[_tableView beginUpdates];
|
||||
// Assume only kitten nodes are selectable (see -tableView:shouldHighlightRowAtIndexPath:).
|
||||
KittenNode *node = (KittenNode *)[_tableView nodeForRowAtIndexPath:indexPath];
|
||||
[node toggleImageEnlargement];
|
||||
[_tableView endUpdates];
|
||||
}
|
||||
|
||||
- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// special-case the first row
|
||||
@@ -123,8 +133,8 @@ static const NSInteger kMaxLitterSize = 100; // max number of kitten cell
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// disable row selection
|
||||
return NO;
|
||||
// Enable selection for kitten nodes
|
||||
return indexPath.section != 0 || indexPath.row != 0;
|
||||
}
|
||||
|
||||
- (void)tableViewLockDataSource:(ASTableView *)tableView
|
||||
|
||||
Reference in New Issue
Block a user