AI Integration Quick Reference
AI Integration Quick Reference
Core Concepts
- One string catalog. Every string the Kit draws lives in
CometChatCore’sLocalizable.xcstrings, so the SwiftUI and UIKit toolkits always say the same thing. - iOS picks the language. The Kit has no language setter: it shows the language iOS runs your app in — the device language, or the per-app language the user chose in Settings.
CometChatStringsexposes the Kit’s strings as read-only properties, so your own views can reuse the Kit’s wording.
Supported Languages
In a language the catalog lacks, the Kit falls back to English.
Set the UI Kit Language
iOS runs an app only in the languages the app declares, and the Kit follows the app. Add each language you support to your app target — in Xcode, Project ▸ Info ▸ Localizations, or theCFBundleLocalizations key:
Info.plist
- SwiftUI
- UIKit
No setup beyond the app’s localizations — the toolkit reads the catalog on every render:
There is no locale setter: the language is the one iOS runs your app in.
Override UI Kit Labels
The catalog cannot be overridden from your app — there is nostrings.xml-style merge on iOS.
Change a label through the component that shows it:
- SwiftUI
- UIKit
CometChatStrings:
- SwiftUI
- UIKit
Customize Date & Time Labels
CometChatDateTimeFormatter has nine buckets — time, today, yesterday, lastWeek,
otherDays, minute, minutes, hour, hours. Each returns String?; nil, or leaving
the method out, keeps the Kit’s text, so you change only the buckets you care about.
- SwiftUI
- UIKit
DateFormatter passed as dateFormat: replaces the formatter wholesale and wins over it.otherDays, the UIKit one every bucket.
Additional API
The Kit has no locale getters or reset: use
Locale.current and the view’s layout direction.
Next Steps
Sound Manager
The incoming-message sound.
Theme Introduction
Colours, fonts and dark appearance.