AI Integration Quick Reference
AI Integration Quick Reference

Prerequisites
You need three things from the CometChat Dashboard:
You also need:
- Xcode 26 or later
- An iPhone or simulator running iOS 18 or later
- Swift 6
Step 1 — Create an iOS Project
- Open Xcode and choose File ▸ New ▸ Project….
- Select iOS ▸ App and click Next.
- Enter a product name and organization identifier.
- Choose the interface for your toolkit — SwiftUI for the SwiftUI toolkit, Storyboard for the UIKit toolkit — and Swift as the language.
- Set the target’s Minimum Deployments to iOS 18.0.
Step 2 — Add the Package
The UI Kit ships as one Swift package with a product per toolkit. Add one of them.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 Xcode, choose File ▸ Add Package Dependencies….
- Paste the package URL:
https://github.com/cometchat/cometchat-uikit-ios.git - Set Dependency Rule to Up to Next Major Version from
6.0.0-beta.1. - Add the product for your toolkit to your app target:
- SwiftUI
- UIKit
Add
CometChatSwiftUI. It re-exports CometChatCore, so
import CometChatSwiftUI is all your SwiftUI files need — plus import CometChatSDK where you name
SDK types such as User or Group.Package.swift instead:
Package.swift
v6 is in beta. A rule that starts at
6.0.0-beta.1 includes the pre-releases and moves to 6.0.0 when
it ships; a rule that starts at 6.0.0 resolves nothing until then.v6 is distributed through Swift Package Manager only — there is no CocoaPods pod. The two toolkits
are peers over one data layer, not layers you stack: an app uses one of them.
Step 3 — Add Permissions
The composer records voice notes and takes photos, and calls use the microphone and camera. Add these keys to your target’sInfo.plist (Target ▸ Info ▸ Custom iOS Target Properties):
Info.plist
Step 4 — Initialise and Log In
CometChatSession is the Kit’s entry point in both toolkits. initialize sets the app up — and turns
on presence for every user, which the lists need to show online dots — then login signs a user in.
Both are async, so the order is simply the order you write them in.
- SwiftUI
- UIKit
Run them from a
.task on your first view, and render the chat once they finish:ContentView.swift
APP_ID, REGION and AUTH_KEY with your app’s credentials and UID with a user’s ID. Every
new CometChat app comes with test users — cometchat-uid-1 to cometchat-uid-5.
To turn on voice and video calling, initialise with
enableCalling: true —
CometChatSession.initialize(appID:region:enableCalling:). See
Calling Integration.Choose Your UI Toolkit
The rest of the integration — showing a screen and customising it — depends on your toolkit. Follow the guide that matches your project:SwiftUI
Step-by-step integration with
CometChatSwiftUI views, modifiers and NavigationStackUIKit
Step-by-step integration with
CometChatUIKit view controllers, cells and delegatesBuild Your Own Chat Experience
Conversation List + Message View
A chat list that opens a full-screen chat
One-to-One / Group Chat
Open a single chat directly
Tab-Based Chat
Chats, Calls, Users and Groups in a tab bar
Components
Every prebuilt component
Next Steps
Components Overview
Browse all prebuilt UI components
Theming
Customize colors, fonts, and styles
Core Features
Chat features included out of the box
Troubleshooting
Common issues and fixes