Skip to main content
Version: v4

File Bubble

CometChatFileBubble is the content view for a MediaMessage if the media sent is an file.

Methods

MethodsTypeDescription
set(fileUrl: String)StringUsed to set the file url for the bubble
set(title: String)StringUsed to set the file title
set(subTitle: String)StringUsed to set the file subtitle
set(style: FileBubbleStyle)FileBubbleStyleUsed to set the customization of the file bubble

FileBubbleStyle

BubbleStyle is the class containing methods to customize appearance of this bubble.

MethodsTypeDescription
set(titleColor: UIColor)UIColorused to set title text color of the message
set(titleFont: UIFont)UIFontused to set title text font of the message
set(subtitleColor: UIColor)UIColorused to set sub title text color of the message
set(subtitleFont: UIFont)UIFontused to set sub title font of the message
set(iconTint: UIColor)UIColorused to provide color to the audio play icon
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 file bubble style object
let fileBubbleStyle = FileBubbleStyle()

//modify style properties
fileBubbleStyle.set(background: .black)
fileBubbleStyle.set(borderWidth: 2.0)
fileBubbleStyle.set(borderColor: .black)
fileBubbleStyle.set(cornerRadius: CometChatCornerStyle(cornerRadius: 5.0))
fileBubbleStyle.set(titleColor: .red)
fileBubbleStyle.set(titleFont: UIFont.systemFont(ofSize: 12.0))
fileBubbleStyle.set(subtitleFont: UIFont.systemFont(ofSize: 10.0))
fileBubbleStyle.set(subtitleColor: .darkText)
fileBubbleStyle.set(iconTint: .darkGray)

//set style to the file bubble object
fileBubble.set(style: fileBubbleStyle)