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
: ALMStackView
that holds the creator's profile image and name/time information.nameAndTimeContainerView
: ALMStackView
containing the creator's name and message creation time.nameLabel
: ALMLabel
displaying the creator's name.timeLabel
: ALMLabel
showing the message creation time.creatorProfileImageView
: AnLMChatProfileView
displaying the creator's profile image.chatroomTitleLabel
: ALMLabel
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
}