AI Integration Quick Reference
AI Integration Quick Reference
initialize and login working).
What You’re Building
Three parts working together:- Conversation list — every conversation of the logged-in user, one-to-one and group
- Message header — the user’s or group’s name, avatar, and status or member count
- Message list + composer — the chat history, live, and the input
- SwiftUI
- UIKit
A
NavigationStack holds the conversation list. A tap stores the chat in @State, and
navigationDestination(item:) pushes the chat screen.
Step 1: Set Up the Conversation List
- SwiftUI
- UIKit
Create
ChatsView.swift. CometChatConversations brings its own NavigationStack unless you pass
embedsNavigationStack: false — pass it, because the chat is pushed onto yours:ChatsView.swift
Step 2: Set Up the Message Screen
- SwiftUI
- UIKit
Create
MessageView.swift. The list fills the screen, and the header and the composer are bars over it.
The rows scroll under their Liquid Glass on iOS 26 and still come to rest clear of them. Host the bars
with safeAreaBar on iOS 26: it also carries the list’s scroll edge effect under each bar, so the rows
fade softly behind it. Earlier versions have no edge effect, and safeAreaInset hosts the bars the same
way. Stacked in a VStack instead, nothing passes under the bars and the glass has nothing to show.The header is the screen’s bar. Keep the navigation bar, empty and clear, instead of hiding it: a
hidden bar comes back when the swipe back starts and is drawn over the chat, with the list’s title and
search field in it. A bar that stays cross-fades to the list’s. SwiftUI drops a bar that has nothing in
it, so ask for it by name, and take its height back off the screen’s safe area so the header keeps its
place under the status bar. Call dismiss from the header’s back button — it never pops by itself:MessageView.swift

Step 3: Show It After Login
- SwiftUI
- UIKit
Render
ChatsView from ContentView once login finishes:ContentView.swift
Step 4: Run the Project
Build and run. The logged-in user’s conversations load; tap one to open the chat, and the header’s back button returns to the list. Messages you send appear at once, and incoming ones arrive live. The composer needs the camera, microphone and photo-library usage descriptions inInfo.plist — see
Step 3 of Getting Started.
Next Steps
Components Overview
Explore all available UI Kit components and their customization options
Theming
Customize colors, fonts, and styles to match your brand
Integration
Back to the main integration guide
Feature Guides
Add capabilities like threaded messages, blocking, and group management