Skip to content

Commit da03b32

Browse files
Updated the docs
1 parent 735b9f6 commit da03b32

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docusaurus/docs/iOS/swiftui/components/message-list.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@ public func makeSystemMessageView(
171171

172172
The only parameter you receive in this method is the system `ChatMessage` that's going to be displayed. Note, if you are using custom implementation of the message container, you will need to explicitly add handling for the system messages.
173173

174+
## Author and Date View
175+
176+
When a message is sent by the current user or another user in a direct channel, the date of the sent message is displayed below the message. In order to swap this view, you need to implement the `makeMessageDateView` in the `ViewFactory`:
177+
178+
```swift
179+
func makeMessageDateView(for message: ChatMessage) -> some View {
180+
MessageDateView(message: message)
181+
}
182+
```
183+
184+
If a message is sent by another user, in a group conversation, the author's name is shown before the date. In order to customize this behaviour, you need to implement your own version of this view, with the `makeMessageAuthorAndDateView` method:
185+
186+
```swift
187+
func makeMessageAuthorAndDateView(for message: ChatMessage) -> some View {
188+
MessageAuthorAndDateView(message: message)
189+
}
190+
```
191+
174192
## No Messages View
175193

176194
When there are no messages available in the channel, you can provide your own custom view. To do this, you will need to implement the `makeEmptyMessagesView` method in the `ViewFactory`. In this method, the `channel` is provided as a parameter, allowing you to provide a personalized message for starting a conversation. The `colors` are provided as a parameter too. The default implementation in the SDK just shows the message list background in this slot.

0 commit comments

Comments
 (0)