当用户点击它时如何显示图像?
func configureMediaMessageImageView(_ imageView: UIImageView, for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) {
switch message.kind {
case .photo(let photoItem):
/// if we don't have a url, that means it's simply a pending message
guard let url = photoItem.url else {
imageView.kf.indicator?.startAnimatingView()
return
}
imageView.kf.indicatorType = .activity
imageView.kf.setImage(with: url)
imageView.addTapGesture {
print("hello")// NOT triggered
}
default:
break
}
}
func didTapImage(in cell: MessageCollectionViewCell) {
print("Hello") //Triggered
}
我不明白如何在这里打开图像!
这是我使用的代码,