Skip to main content
Enable the current group owner to delegate ownership to another member using CometChat’s UIKit for iOS.

Overview

The Transfer Group Ownership feature provides a modal interface where the group owner can:
  • See a list of current group members (excluding themselves)
  • Select exactly one member to become the new owner
  • Trigger the ownership transfer API call
  • Automatically exit the group after successful transfer

Prerequisites

Before implementing ownership transfer, ensure you have:
  • Completed Getting Started setup
  • CometChat UIKit v5+ installed via CocoaPods or Swift Package Manager
  • CometChatSDK and CometChatUIKitSwift integrated
  • User logged in with CometChatUIKit.login()
  • UINavigationController or modal presentation flow set up
  • Group context (GUID) available when invoking the transfer screen

Components

Integration Steps

Step 1: Present Transfer Ownership Screen

Show the ownership transfer UI modally:
File reference: GroupDetailsViewController.swift

Step 2: Configure Single Selection Mode

Restrict selection to one member and capture selection:
File reference: TransferOwnership.swift

Step 3: Load and Filter Member List

Exclude the current owner from the selectable list:
File reference: TransferOwnership.swift

Step 4: Perform Ownership Transfer

Call the API, emit event, and exit the group:
File reference: TransferOwnership.swift

Step 5: Manage Loading State

Provide visual feedback during network calls:
File reference: TransferOwnership.swift

Complete Implementation

Here’s the complete TransferOwnership class:

Customization Options

Title Text

Replace localization key with custom string:

Spinner Style

Adjust spinnerView.style and color using CometChatTheme:

Error Handling

Customize error alerts in the onError closure:

Edge Cases

Error Handling

Feature Matrix

Groups

Display and manage groups

Group Members

View and manage group membership

Group Chat Guide

Complete group management guide