Skip to main content

Header Message View

Overview

The LMChatroomHeaderMessageView is a custom view component responsible for displaying header information in a chatroom. It presents details such as the creator's profile, chatroom title, and creation time.

UI Components

  • creatorProfileContainerView: A LMStackView that holds the creator's profile image and name/time information.
  • nameAndTimeContainerView: A LMStackView containing the creator's name and message creation time.
  • nameLabel: A LMLabel displaying the creator's name.
  • timeLabel: A LMLabel showing the message creation time.
  • creatorProfileImageView: An LMChatProfileView displaying the creator's profile image.
  • chatroomTitleLabel: A LMLabel presenting the chatroom title.

Properties

  • onTopicViewClick: A closure that can be set to handle topic view click events.
  • topicData: Stores the content model for the view.

Methods

  • setData(_:): Populates the view with data.

Customization

CustomChatroomHeaderMessageView.swift
class CustomChatroomHeaderMessageView: LMChatroomHeaderMessageView {
override func setupAppearance() {
super.setupAppearance()
backgroundColor = .lightGray
}

override func setupViews() {
super.setupViews()
// Add additional views or modify existing ones
}

override func setData(_ data: ContentModel) {
super.setData(data)
// Customize data presentation
}
}
AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
LMUIComponents.shared.chatroomHeaderMessageView = CustomChatroomHeaderMessageView.self
// ...
return true
}