3

I tried to change bubble outline with below code but always showing black outline color.

func messageStyle(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> MessageStyle {
    return .bubbleOutline(UIColor.red)
}

Link Sample: https://github.com/MessageKit/MessageKit

Page: ConversationViewController.swift

Method: messageStyle in extension ConversationViewController: MessagesDisplayDelegate

I have 2 users and I want to show bubble outline color different for each user. But with above code in the provided sample is not working.

Please help. Thanks in advance.

enter image description here enter image description here

yoninja
  • 1,952
  • 2
  • 31
  • 39
Asif Raza
  • 836
  • 12
  • 29

1 Answers1

3

I used the .bubbleTailOutLine method instead and that worked for me.

func messageStyle(for message: MessageType, at indexPath: IndexPath, in  messagesCollectionView: MessagesCollectionView) -> MessageStyle {
    let corner: MessageStyle.TailCorner = isFromCurrentSender(message: message) ? .bottomRight : .bottomLeft
    let borderColor:UIColor = isFromCurrentSender(message: message) ? .orange: .clear
    return .bubbleTailOutline(borderColor, corner, .curved)
}

Bubble message with orange border

usha
  • 31
  • 6