Skip to main content
Version: v4

Text Bubble

CometChatTextBubble is the content view shown for TextMessage.

MethodsTypeDescription
set(text: String)Stringthe text to display
set(style: TextBubbleStyle)TextBubbleStyleused to customize appearance of this bubble

TextBubbleStyle

TextBubbleStyle is the class containing attributes to customize appearance of this widget.

MethodsTypeDescription
set(titleFont: UIFont)UIFontused to set font of the text of the message
set(titleColor: UIColor)UIColorused to set color of the text of the message
set(background: UIColor)UIColorused to set background color
set(borderColor: UIColor)UIColorused to set a border color
set(borderWidth: CGFloat)CGFloatused to set border
set(cornerRadius: CometChatCornerStyle)CometChatCornerStyleused to set border radius

Usage

//create text bubble style object
let textBubbleStyle = TextBubbleStyle()

//modify the style properties
textBubbleStyle.set(titleColor: .black)
textBubbleStyle.set(titleFont: UIFont.systemFont(ofSize: 12.0))
textBubbleStyle.set(background: .blue)
textBubbleStyle.set(borderColor: .blue)
textBubbleStyle.set(borderWidth: 2.0)
textBubbleStyle.set(cornerRadius: CometChatCornerStyle(cornerRadius: 5.0))

//set style to the text bubble object
textBubble.set(style: textBubbleStyle)