Skip to main content
This guide adds the UIKit toolkit to an iOS app. The toolkit is a native implementation — real view controllers, cells and delegates, not SwiftUI views in a hosting controller. It suits apps upgrading from v5; see Migrating from v5. By the end you have a working chat screen.

Prerequisites

You need your app’s App ID, Auth Key and Region from the CometChat Dashboard (Your App → Credentials), Xcode 26 or later, and an iPhone or simulator running iOS 18 or later.
Auth Key is for development only. In production, generate Auth Tokens on your server with the REST API and log in with CometChatSession.login(authToken:). Never ship an Auth Key in an app binary.

Step 1 — Create an iOS Project

  1. In Xcode, choose File ▸ New ▸ Project… and select iOS ▸ App.
  2. Enter a product name, and choose Storyboard for Interface and Swift for Language.
  3. Set the target’s Minimum Deployments to iOS 18.0.
This guide builds its screens in code. To stop the storyboard from loading as well, delete Main.storyboard and remove the Storyboard Name entry from Info ▸ Application Scene Manifest ▸ Scene Configuration in your target.

Step 2 — Add the Package

  1. Choose File ▸ Add Package Dependencies… and paste https://github.com/cometchat/cometchat-uikit-ios.git.
  2. Set Dependency Rule to Up to Next Major Version from 6.0.0-beta.1.
  3. Add the CometChatUIKit product to your app target.
That is the only dependency you declare. CometChatCore, the CometChat Chat SDK, the Cards SDK and the Calls SDK resolve with it. The Calls SDK is included even when you don’t use calling; see Calling to leave it out. In a Package.swift:
Package.swift
Then add the camera, microphone and photo-library usage descriptions to Info.plist — see Step 3 of Getting Started.
v6 is SPM only. If your v5 app integrates through CocoaPods, moving to SPM is part of the upgrade — see Migrating from v5.

Step 3 — Initialise and Log In

Initialise the Kit and log in from your scene delegate, then set the window’s root view controller once both finish. CometChatSession lives in CometChatCore, which CometChatUIKit re-exports, so one import is enough:
SceneDelegate.swift
Replace APP_ID, REGION and AUTH_KEY with your credentials, and UID with a user’s ID — every new app has test users cometchat-uid-1 to cometchat-uid-5. Run the app: you see the logged-in user’s conversations, live.
The conversation list the minimal UIKit example shows
initialize must finish before login, and login before any component appears — a component shown first has no session and shows nothing. region must match your app’s region: a mismatch fails at login, not at initialize, which makes it look like an authentication problem.

Step 4 — Choose a Chat Experience

Pick the layout that suits your app. Each guide builds it step by step.

Conversation List + Message View

Sequential navigation — the conversation list is the entry point, and a tap pushes a full-screen chat.

Build Conversation List + Message View

CometChatConversations in a UINavigationController, pushing a chat screen

One-to-One / Group Chat

A single chat window with no list. It opens a specific user’s or group’s chat directly — ideal for support chat, direct messages, or notification-driven flows.

Build One-to-One / Group Chat

Header, message list and composer for one chat

Tab-Based Chat

A UITabBarController with Chats, Calls, Users and Groups.

Build Tab-Based Chat

Each tab hosts a CometChat view controller

Make It Yours

Three routes, in increasing order of power. Configure — properties, fluent setters and view slots:
Replace the cell — supply your own UITableViewCell subclass:
A custom cell must clear its custom subviews in prepareForReuse(), or the wrong content appears on the next row during fast scrolling. The built-in cell does this.
Subclass — the override points are open:
defaultSetup, setupStyle, showEmptyView, showErrorView, reloadData, configureMenu and updateNavigationBarTitleWithCount are all overridable. See Conversations for the whole surface, and Theming for colours and typography.

Next Steps

Components Overview

Browse all available UI Kit components

Theming

Customize colors, fonts, and styles

Core Features

Chat features included out of the box

Migrating from v5

Move a CometChatUIKitSwift 5.x app to v6