UI Customization

It is possible to customize the chat UI colors and fonts to match the rest of your app.

Custom Colors

Colors are retrieved from an instance of a struct called Theme. There are a handful of predefined themes available to use as a reference, but you can create your own by calling one of the constructors of Theme with your desired color settings. Some of the arguments to the constructor may be omitted, in which case the missing colors are computed programmatically from the ones given. Not all such combinations result in readable themes, however, so it is recommended to either define all colors or to test the results of auto-generation extensively.

let myTheme: Theme = Theme(name: "MyTheme", darkMainColor: .green, textOnMain: .blue)
Theme.current = myTheme

Custom Fonts

Fonts are stored statically on UIFont making it possible to customize by simply assigning to those values. Here is an example of changing the font used on the message body of incoming texts:

UIFont.messageBodyIncoming = UIFont.preferredFont(forTextStyle: .body)