MXRMessenger icon indicating copy to clipboard operation
MXRMessenger copied to clipboard

Provide a delegate call for tap avatar.

Open skensell opened this issue 7 years ago • 0 comments

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;

skensell avatar Aug 30 '17 23:08 skensell