MXRMessenger
MXRMessenger copied to clipboard
Provide a delegate call for tap avatar.
This should also be pretty easy. The avatarNode
on the message cell node is already an ASNetworkImageNode
so we can have the message cell add itself as a target-action and then relay the message to a delegate. I guess this would need a new delegate protocol. Anyways, the current workaround is ok as-is:
block = [self.cellFactory cellNodeBlockWithText:text tableNode:tableNode row:indexPath.row];
__weak typeof(self) weakSelf = self;
MXRMessageCellNodeBlock finalBlock = ^MXRMessageCellNode*(){
MXRMessageCellNode* cellNode = block();
[cellNode.avatarNode addTarget:weakSelf action:@selector(tapAvatar:) forControlEvents:ASControlNodeEventTouchUpInside];
return cellNode;
};
return finalBlock;