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]
}
}