MessageHeader
is a Component that showcases the User or Group details in the toolbar. Furthermore, it also presents a typing indicator and a back navigation button for ease of use.
MessageHeader
is comprised of the following components:
Components | Description |
---|---|
ListItem Component | This component’s view consists of avatar, status indicator , title, and subtitle. The fields are then mapped with the SDK’s user, group class. |
Back Button | BackButton that allows users to navigate back from the current activity or screen to the previous one |
MessageHeader
component directly by setting the user.
MessageHeader
component does not have any exposed actions.
Component
. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders
of Chat SDK.
The MessageHeader
component does not have any exposed filters.
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
The MessageHeader
component does not produce any events.
MessageHeaderStyle
object to the MessageHeader
component.
MessageHeaderStyle
are as follows:
Property | Description | Method |
---|---|---|
Set BorderWidth | Used to set border | .set(borderWidth: CGFloat) |
Set BorderColor | Used to set border color | .set(borderColor: UIColor) |
Set CornerRadius | Used to set corner radius | .set(cornerRadius: CometChatCornerStyle) |
Set Background | Used to set background colour | .set(background: UIColor) |
Set BackIconTint | Used to set back button icon tint | .set(backIconTint: UIColor) |
Set TypingIndicatorTextAppearance | Used to set typing indicator textStyle | .set(typingIndicatorTextFont: UIFont) |
Set TypingIndicatorTextColor | Used to set typing indicator text color | .set(typingIndicatorTextColor: UIColor) |
Set SubtitleTextAppearance | Used to set subtitle text style | .set(subtitleTextFont: UIFont) |
Set SubtitleTextColor | Used to set subtitle text color | .set(subtitleTextColor: UIColor) |
Set DetailIconTint | Sets the tint color for detail icon for message header | .set(detailIconTint: UIColor) |
Set OnlineStatusColor | Sets the online status color for message header | .set(onlineStatusColor: UIColor) |
Set PrivateGroupIconBackgroundColor | Sets the private group background color for message header | .set(privateGroupIconBackgroundColor: UIColor) |
Set ProtectedGroupIconBackgroundColor | Sets the protected group background color for message header | .set(protectedGroupIconBackgroundColor: UIColor) |
Avatar
component within the MessageHeader
Component, you can use the following code snippet. For more information you can refer Avatar Styles.
ListItemStyle
component within the MessageHeader
Component, you can use the following code snippet. For more information, you can refer ListItem Styles.
Status Indicator
component within the MessageHeader
Component, you can use the following code snippet. For more information you can refer StatusIndicator Styles.
Property | Description | Code |
---|---|---|
User | Used to pass user object of which header specific details will be shown | .set(user: User) |
Group | Used to pass group object of which header specific details will be shown | .set(group: Group) |
ProtectedGroupIcon | Used to set custom protected group icon | .set(protectedGroupIcon: UIImage) |
PrivateGroupIcon | Used to set custom private group icon | .set(privateGroupIcon: UIImage) |
Hide BackIcon | Used to toggle back button visibility | .hide(backButton: Bool) |
Disable Typing | Used to enable /disable typing indicators | .disable(typing: Bool) |
Disable UsersPresence | Used to toggle functionality to show user’s presence | .set(disableUsersPresence: Bool) |
.setSubtitle
method, you can modify the SubtitleView to meet your specific needs.
customSubtitleView
file and pass it inside messageHeaderConfiguration
function.
cometChatMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.uid
and name
.set(backIcon: UIImage)
method.
custom_back_icon
UIImage or can use system named UIImage, and then pass it to the MessageHeaderConfiguration
method.
cometChatMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller..setMenu()
method.
Custom_Menus
UIView file, and then pass it to MessageHeaderConfiguration()
method.
cometChatMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.