CometChatBannedMembers
is a crucial Component that showcases users who have been restricted from participating in specific groups or conversations. Once banned, users lose access to content and discussions within the affected group. Administrators or owners wield the authority to ban members from groups they oversee, enabling them to monitor user activity and behavior closely. With CometChatBannedMembers, administrators can take swift and appropriate actions to maintain group integrity and uphold community standards.
BannedMembers
component is composed of the following BaseComponents:
Components | Description |
---|---|
CometChatListBase | CometChatListBase serves as a container component equipped with a title (navigationBar), search functionality (search-bar), background settings, and a container for embedding a list view. |
CometChatListItem | This component renders information extracted from a User object onto a tile, featuring a title, subtitle, leading view, and trailing view. |
CometChatBannedMembers
, as a custom view controller, offers flexible integration options, allowing it to be launched directly via button clicks or any user-triggered action. Additionally, it seamlessly integrates into tab view controllers. With banned members, users gain access to a wide range of parameters and methods for effortless customization of its user interface.
The following code snippet exemplifies how you can seamlessly integrate the BannedMembers component into your application.
setOnItemClick
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
setOnItemLongClick
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
On Error
and improve error handling.
SetOnBack
feature. This capability allows you to customize the behavior associated with navigating back within your app. Utilize the provided code snippet to override default behaviors and tailor the user experience according to your specific requirements.
BannedMembersRequestBuilder
enables you to filter and customize the Banned Members list based on available parameters in BannedMembersRequestBuilder. This feature allows you to create more specific and targeted queries when fetching banned members. The following are the parameters available in BannedMembersRequestBuilder
Methods | Type | Description |
---|---|---|
setLimit | Int | sets the number of banned members that can be fetched in a single request, suitable for pagination |
setSearchKeyword | String | used for fetching banned members matching the passed string |
BannedMembersRequestBuilder
enables you to filter and customize the search list based on available parameters in BannedMembersRequestBuilder. This feature allows you to keep uniformity between the displayed Banned Members list and searched Banned Members.
Example
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.
Events emitted by the Join Group component is as follows.
Event | Description |
---|---|
onGroupMemberBan | This method is triggered when the logged-in user successfully bans a user from the group. |
onGroupMemberUnban | This method triggers when the logged-in user successfully unbans a previously banned user from the group. |
BannedMembersStyle
to the Banned Members
Component to customize the styling.
Property | Description | Code |
---|---|---|
Background | Sets the background color | set(background: UIColor) |
CornerRadius | Sets the corner radius | set(cornerRadius: CometChatCornerStyle) |
BorderWidth | Sets the border width | set(borderWidth: CGFloat) |
TitleColor | Sets the title color | set(titleColor: UIColor) |
TitleFont | Sets the title font | set(titleFont: UIFont) |
LargeTitleFont | Sets the large title font | set(largeTitleFont: UIFont) |
BackIconTint | Sets the back button tint color | set(backIconTint: UIColor) |
SearchIconTint | Sets the search icon tint color | set(searchIconTint: UIColor) |
SearchTextFont | Sets the search text font | set(searchTextFont: UIFont) |
SearchTextColor | Sets the search text color | set(searchTextColor: UIColor) |
SearchCancelButtonTint | Sets the search cancel icon tint | set(searchCancelButtonTint: UIColor) |
SearchPlaceholderFont | Sets the search placeholder font | set(searchPlaceholderFont: UIFont) |
SearchPlaceholderColor | Sets the search placeholder color | set(searchPlaceholderColor: UIColor) |
OnlineStatusColor | Sets online status color | set(onlineStatusColor: UIColor) |
AddButtonTint | Sets add button color | set(addButtonTint: UIColor) |
AddButtonFont | Sets add button font | set(addButtonFont: UIFont) |
Avatar
component in the Banned Members Component, you can use the following code snippet. For further insights on Avatar
Styles refer
ListItemStyle
component in the Banned Members
Component, you can use the following code snippet. For further insights on ListItemStyle
Styles refer
Property | Description | Code |
---|---|---|
Title | Custom title for the component | .set(title: String, mode: UINavigationItem.LargeTitleDisplayMode) |
BackButtonTitle | Custom text for the back button | .set(backButtonTitle: String?) |
SearchPlaceholderText | Custom placeholder text for search field | .set(searchPlaceholder: String) |
ShowBackButton | Whether to hide the back button | .show(backButton: Bool) |
ErrorStateText | Custom error state text | .set(errorStateText: String) |
BackButtonIcon | Custom back button icon | .set(backButtonIcon: UIImage) |
HideAddButton | Whether to hide the add button | .hide(addButton: Bool) |
SearchPlaceholder | Set the placeholder for search bar | set(searchPlaceholder: String) |
SearchIcon | Sets the icon for the search bar | set(searchIcon:UIImage) |
SearchClearIcon | Sets the clear icon for the search bar | set(searchClearIcon:UIImage) |
SearchBarHeight | Set the height for the search bar | set(searchBarHeight: CGFloat) |
HideSearch | Hide / unhide the search bar as per boolean value | hide(search: Bool) |
SelectionMode | This enables a selection, it has three modes: .single, .multiple | selectionMode(mode: SelectionMode) |
HideSeparator | This method will hide the separator | hide(separator: Bool) |
DisableUserPresence | This method disables user’s online/offline status | disable(userPresence: Bool) |
UpdateGroupMember | This method specifies the option to update member object locally | update(groupMember: GroupMember) |
RemoveGroupMember | This method specifies the option to remove member object locally | remove(groupMember: GroupMember) |
AddGroupMember | This method specifies the option to add member object locally | update(groupMember: GroupMember) |
RemoveGroupMember | This method specifies the option to remove member object locally | remove(groupMember: GroupMember) |
ClearList | This method will clear the users locally | clearList() |
GetSize | This method specifies the count of members displayed | size() |
CustomListItemGroupView
and pass it inside the setListItemView()
method.
CometChatBannedMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller..setSubtitleView()
method. But keep in mind, by using this you will override the default Subtitle view functionality.
Custom_Subtitle_GroupMember_View
a UIView file.
CometChatBannedMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller..set(emptyView: UIView)
to match the empty view of your app.
Custom_Empty_State_GroupView
a UIView file.
CometChatBannedMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller..set(errorView: UIView)
to match the error view of your app.
Custom_ErrorState_GroupView
and pass it inside the .set(errorView: UIView)
method.
CometChatBannedMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.CometChatBannedMembers
, enhancing its interface with a personalized menu
for a more user-friendly experience.
CometChatBannedMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.CometChatBannedMembers
by introducing a tailored feature. By adding a custom option, such as “Delete” with a corresponding trash icon, users can now enjoy a more interactive and user-friendly experience.
CometChatBannedMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.