Friday, December 2, 2022
HomeIOS Developmentfrontend - Messagekit IOS - How you can test whether or not...

frontend – Messagekit IOS – How you can test whether or not the ContactMessageCell is tapped and get the Phonenumber

I am presently growing with IOS and the library Messagekit. I am making an attempt to test, whether or not the ContactMessageCell is tapped. Messagekit doesn’t appear to have a didTap operate like didTapImage or didTapBackground particularly for the ContactCell. `

I’ve tried to make it work with the didTapMessage operate and get entry to the information of the ContactMessageCell via the collectionview however I cant entry the telephone information like title, quantity, e mail. I can print them however not entry them. Has someone an thought? Thx in your assist guys 🙂

func didTapMessage(in cell: MessageCollectionViewCell) {
        if let contact = (cell as? ContactMessageCell) {
            guard let indexPath = messagesCollectionView.indexPath(for: contact)
            else {
                print("Did not determine message when audio cell obtain faucet gesture")
            let message = messagesCollectionView.messagesDataSource?.messageForItem(at: indexPath, in: messagesCollectionView)

results of “print(message)”

Non-compulsory(ChatApp.ChatMessage(sender: ChatApp.Sender(senderId: “self”, displayName: “Thomas”), messageId: “21”, sentDate: 2022-11-21 09:43:41 +0000, sort: “John Appleseed”, initials: “JA”, phoneNumbers: [“888-555-5512”], emails: [“”]))))

struct ContactElement:ContactItem{
var displayName: String
var initials: String
var phoneNumbers: [String]
var emails: [String]



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments