我想添加该功能以双击给定的消息气泡。
到目前为止的代码:
@objc func doubleTap(gesture: UITapGestureRecognizer) {
print("double tap called")
}
func messageStyle(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> MessageStyle {
let tapGesture = UITapGestureRecognizer(target: messagesCollectionView, action: #selector(doubleTap(gesture:)))
tapGesture.numberOfTapsRequired = 2
view.addGestureRecognizer(tapGesture)
let sender = message.sender
if sender.senderId == selfSenderEmail?.senderId {
// Self Message
return .bubbleTailOutline(.blue, .bottomRight, .curved)
}
// More if statements for groupchat color coding
return .bubbleTailOutline(.darkGray, .bottomLeft, .curved)
}
我收到此错误线程 1:“-[MessageKit.MessagesCollectionView doubleTapWithGesture:]:无法识别的选择器已发送到实例 0x7f94c7112a00”。
如果您认为我的帖子无论如何都不清楚,请告诉我,以便我澄清。谢谢