I have downloaded and learned the official MessageKit example. My own messages are displayed on the right, and opponent messages are displayed on the left. However, I can not find a condition in the code that determines where the message will be displayed (left or right). In other words, where is this logic implemented?
It looks like this logic. However, this logic only works for displaying the tail in a message.
func messageStyle(for message: MessageType,
at indexPath: IndexPath,
in messagesCollectionView: MessagesCollectionView) -> MessageStyle {
let tail: MessageStyle.TailCorner = isFromCurrentSender(message: message) ? .bottomRight : .bottomLeft
return .bubbleTail(tail, .curved)
}