Skip to main content
Provide a detailed view for CometChat groups in your iOS app, enabling users to see group info, join/leave, manage members, and respond to real-time group events.

Overview

GroupDetailsViewController displays comprehensive group information and actions:
  • Group Info — Name, icon, description, and member count
  • Actions — Join, leave, or delete group
  • Member Management — View members, add members, view banned members
  • Real-Time Updates — Reflects joins, leaves, bans, and ownership changes

Prerequisites

Before implementing group details, ensure you have:
  • Completed Getting Started setup
  • CometChat UIKit v5+ installed via CocoaPods or Swift Package Manager
  • Valid CometChat App ID, Region, and Auth Key
  • User logged in with CometChatUIKit.login()
  • Navigation controller (UINavigationController) configured

Components

Integration Steps

Step 1: Present the Group Details Screen

Push GroupDetailsViewController for a selected group:
This initializes and presents the details UI with the correct group context. File reference: HomeScreenViewController.swift

Step 2: Set Up the UI

Configure scroll view, header, and action views:
This lays out the UI components and registers for group events. File reference: GroupDetailsViewController.swift

Step 3: Enable Group Action Buttons

Wire up view/add/banned members actions:
This enables user interaction for member management. File reference: GroupDetailsViewController.swift

Step 4: Handle Leave and Delete Actions

Provide ownership-aware leave/delete flows:
This manages group exit, with transfer prompt for owners. File reference: GroupDetailsViewController.swift

Step 5: Listen for Group Events

Update UI on member joins, leaves, bans, and ownership changes:
This keeps the group details in sync with back-end events. File reference: GroupDetailsViewController.swift

Customization Options

Header Styling

Use CometChatTheme to customize fonts, colors, and borders:

Button Labels

Localize or rebrand action texts:

Avatar Placeholder

Provide fallback initials or default images:

Edge Cases

Error Handling

Feature Matrix

Sample App

Explore the complete Group Details flow

UIKit Source

Browse the Group Details implementation

Groups

Display and manage group list

Group Members

View and manage group membership

Events

Handle group and membership events