CometChatTransferOwnership
is a Component that allows the current owner or administrator of a group to transfer the ownership rights and administrative control of that group to another user. By transferring ownership, the original owner can designate a new user as the group owner, giving them full control and administrative privileges over the group.
Here are some key points regarding the transfer ownership feature in CometChat:
Components | Description |
---|---|
CometchatGroupMembers | CometChatGroupMembers is an independent component designed to create a user-friendly screen for browsing and managing group members. Users can effortlessly search for specific members and take actions such as kicking, banning, or changing member scopes directly from the interface. |
CometChatListItem | This component renders information extracted from a User object onto a tile, featuring a title, subtitle, leading view, and trailing view. |
CometChatTransferOwnership
, 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 TransferOwnership component into your application.
setOnTransferOwnership
action is activated when you select a group member and click on the transfer ownership submit button. you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
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.
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 |
setScope | [String] | used for fetching group members based on multiple scopes |
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 |
---|---|
onOwnershipChange | Triggers when the ownership of a group member is changed successfully |
Property | Description | Code |
---|---|---|
Background | Sets the background color for | set(background: UIColor) |
CornerRadius | Sets the corner radius for | set(cornerRadius: CometChatCornerStyle) |
BorderWidth | Sets the border width for | set(borderWidth: CGFloat) |
TitleColor | Sets the title color for | set(titleColor: UIColor) |
TitleFont | Sets the title font for | set(titleFont: UIFont) |
LargeTitleFont | Sets the large title font for | set(largeTitleFont: UIFont) |
BackIconTint | Sets the back button tint color for | 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 for | set(searchPlaceholderFont: UIFont) |
SearchPlaceholderColor | Sets the search placeholder color | set(searchPlaceholderColor: UIColor) |
TransferButtonFont | Sets transfer button color | set(addButtonTint: UIColor) |
transferButtonTint | Sets transfer button font | set(addButtonFont: UIFont) |
Avatar
component in the Transfer ownership Component, you can use the following code snippet. For further insights on Avatar
Styles refer
ListItemStyle
component in the Transfer ownership
Component, you can use the following code snippet. For further insights on ListItemStyle
Styles refer
GroupMembersStyle
to the Transfer Ownership Component to customize the styling, you can use the following code snippet. For further insights on GroupMembers
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 | add(groupMember: GroupMember) |
InsertGroupMember | This method specifies the option to add member object locally at specified location | insert(groupMember: GroupMember, at: Int) |
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.
CometChatTransferOwnership
. 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.
CometChatTransferOwnership
. 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.
CometChatTransferOwnership
. 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.
CometChatTransferOwnership
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.CometChatTransferOwnership
, enhancing its interface with a personalized menu
for a more user-friendly experience.
CometChatTransferOwnership
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.CometChatTransferOwnership
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.
CometChatTransferOwnership
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.