(void) stopVoiceAnimation;
The above two methods are written in the cell and are used to start and stop the picture animation. The Cell has a mark. When clicking the voice, use the block to return the Cell identifier (rowIdentifier, when creating the Cell, cell.rowIdentifier = indexPath.row;) and audio File path to Chat VC
Play the audio file after receiving it in the chat VC, and cache cell.rowIdentifier to _rowPlayVoiceAnimationIdentifier, and then traverse visibleCells. If the Cell identifier (row) is the same as the cached one, call the Cell playVoiceAnimation method
Called after audio playback ends, same as above, call Cell stopVoiceAnimation method
Handling when scrolling:
//When the cell is about to be displayed, if it is a Cell that is playing the recording file, then execute the Cell to play the recording animation
if (((ACChatTableViewCell *)cell).rowIdentifier == _rowPlayVoiceAnimationIdentifier) {
[((ACChatTableViewCell *)cell) startVoiceAnimation];
}
Finally I know, this is what I did,
The above two methods are written in the cell and are used to start and stop the picture animation. The Cell has a mark. When clicking the voice, use the block to return the Cell identifier (rowIdentifier, when creating the Cell, cell.rowIdentifier = indexPath.row;) and audio File path to Chat VC
Play the audio file after receiving it in the chat VC, and cache cell.rowIdentifier to _rowPlayVoiceAnimationIdentifier, and then traverse visibleCells. If the Cell identifier (row) is the same as the cached one, call the Cell playVoiceAnimation method
Called after audio playback ends, same as above, call Cell stopVoiceAnimation method
Handling when scrolling:
//When the cell is about to be displayed, if it is a Cell that is playing the recording file, then execute the Cell to play the recording animation
if (((ACChatTableViewCell *)cell).rowIdentifier == _rowPlayVoiceAnimationIdentifier) {
[((ACChatTableViewCell *)cell) startVoiceAnimation];
}
It’s a bit messy! ! !
Is there any demo for reference?
632582467@qq.com