Message Bubble

UIKit allows all types of message bubble to be replaced.

Text message bubble

Image massage bubble.

Audio message bubble

Usage

To customise message UI need to create new UITableViewCell and conform to protocol EkoMessageCellProtocol

import UIKit
import UpstraUIKit

class CustomTableViewCell: UITableViewCell, EkoMessageCellProtocol {
    func display(message: EkoMessageModel) {
        // Do stuff
    }
}
import UIKit
import UpstraUIKit

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

extension ClientViewController: EkoMessageListDataSource {
    func cellForMessageTypes() -> [EkoMessageTypes: EkoMessageCellProtocol.Type] {
        return [.textIncoming: CustomTableViewCell.self]
    }
}

Last updated