Trying to load an image for the Avatar, but it ends up being mixed and matched between both users.
` func configureAvatarView(_ avatarView: AvatarView, for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) {
let message = self.viewModel.getMessage(indexPath: indexPath) as? Message
avatarView.tryLoad(from: message?.user.photoUrl)
}`
Image for the sender sometimes is showing on the receiver message.
Hey @ahmedwasil
It looks like you are loading and setting the avatar image asynchronously but not cancelling the request when the cell is reused?
You can use something like https://github.com/pinterest/PINRemoteImage that will handle the cancellation for you
Thank You that worked a treat!
@ahmedwasil awesome!
Most helpful comment
Hey @ahmedwasil
It looks like you are loading and setting the avatar image asynchronously but not cancelling the request when the cell is reused?
You can use something like https://github.com/pinterest/PINRemoteImage that will handle the cancellation for you