Message bubble

UIKit allows all types of message bubble to be replaced.

Text message bubble

Image massage bubble.

Audio message bubble

Usage

To customize message UI, create a new UITableViewCell and conform to AmityMessageCellProtocol.

import UIKit
import AmityUIKit

class CustomTableViewCell: UITableViewCell, AmityMessageCellProtocol {
    func display(message: AmityMessageModel) {
        // Do stuff
    }
}
import UIKit
import AmityUIKit

class ClientViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func showChatPage(_ sender: UIButton) {
        let chatVC = AmityChatHomePageViewController.make()
        chatVC.messageDataSource = self
        present(recentChatVC, animated: true)
    }
}

extension ClientViewController: AmityMessageListDataSource {
    func cellForMessageTypes() -> [AmityMessageTypes: AmityMessageCellProtocol.Type] {
        return [.textIncoming: CustomTableViewCell.self]
    }
}

Last updated