Skip to main content

Chat Participant View

Overview

The LMChatParticipantView is used to display information about a participant. It presents the participant's profile image, name, designation, custom title, and pending status.

File Location:
LMChatParticipantView.swift

UI Components

  • containerView: The main LMView container for the participant view.
  • subviewContainer: A LMView container with rounded corners for the participant's information.
  • participantContainerStackView: A horizontal LMStackView that arranges the profile image and text information.
  • participantNameAndDesignationContainerStackView: A vertical LMStackView that stacks the name and designation information.
  • participantNameContainerStackView: A horizontal LMStackView that arranges the name and custom title.
  • participantDesignationContainerStackView: A LMView that contains the designation label.
  • nameLabel: An LMLabel that displays the participant's name.
  • designationLabel: An LMLabel that shows the participant's designation or role.
  • customTitle: An LMLabel that presents any custom title assigned to the participant.
  • pendingTextLabel: An LMLabel that indicates if the participant's status is pending.
  • profileImageView: An LMImageView that displays the participant's profile image.
  • moreActionsContainerStackView: A LMStackView that contains action buttons for participant management.
  • rejectImageView: An LMImageView icon for rejecting a participant (if applicable).
  • approveImageView: An LMImageView icon for approving a participant (if applicable).
  • moreOptionsImageView: An LMImageView icon for accessing more options related to the participant.

Methods

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

Customization

CustomChatParticipantView.swift
class CustomChatParticipantView: LMChatParticipantView {
override func setupAppearance() {
super.setupAppearance()
subviewContainer.backgroundColor = .lightGray
}

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