Customize Chatroom - imkit/imkit-ios-framework-v3 GitHub Wiki

Illustration

If you want to attach some customized views to chatroom, we offer tow places.

  1. Down below the navigation bar.(blue view)
  2. On top if input accessory view.(yellow view)

How to do that?

Override IMRoomsViewController and IMMessagesViewController two main ui components of IMKit.

import IMKit

class RoomsViewController: IMRoomsViewController {
    override func didSelectRoom(room: IMRoom) {
        navigationController?.pushViewController(MessagesViewController(roomID: room.id), animated: true)
    }
}
class MessagesViewController: IMMessagesViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        let topCustomView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 60))
        topCustomView.backgroundColor = .blue
        customView = topCustomView
        let bottomCustomView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 40))
        bottomCustomView.backgroundColor = .yellow
        inputBarViewController.customView = bottomCustomView
    }
}