Skip to content

Commit fb4b174

Browse files
Updated the docs
1 parent ff90e2e commit fb4b174

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ let messageDisplayOptions = MessageDisplayOptions(
4949
)
5050
```
5151

52-
For link attachments, you can control the link text attributes (font, font weight, color) based on the message. Here's an example how to change the link color based on the message sender, with the `messageLinkDisplayResolver`:
52+
For link attachments, you can control the link text attributes (font, font weight, color) based on the message. Here's an example of how to change the link color based on the message sender, with the `messageLinkDisplayResolver`:
5353

5454
```swift
5555
let messageDisplayOptions = MessageDisplayOptions(messageLinkDisplayResolver: { message in
5656
let color = message.isSentByCurrentUser ? UIColor.red : UIColor.green
57-
return [
58-
NSAttributedString.Key.foregroundColor: color
59-
]
60-
})
57+
58+
return [
59+
NSAttributedString.Key.foregroundColor: color
60+
]
61+
})
6162
let messageListConfig = MessageListConfig(messageDisplayOptions: messageDisplayOptions)
6263
let utils = Utils(messageListConfig: messageListConfig)
6364

@@ -66,14 +67,14 @@ let streamChat = StreamChat(chatClient: chatClient, utils: utils)
6667

6768
## Date Indicators
6869

69-
The SDK supports two types of date indicators - floating overlay and date separators inside the messages. This feature can be configured via the `dateIndicatorPlacement` in the `MessageListConfig`. With the floating overlay option (`.overlay`), the date indicator is shown for a short time whenever a new message appears. On the other hand, if you want to always show the date between messages, similarly to Apple Messages and WhatsApp, you should use the `.messageList` option. You can turn off both options by using the `.none` option. Here's an example how to setup the `messageList` option:
70+
The SDK supports two types of date indicators - floating overlay and date separators in-between the messages. This feature can be configured via the `dateIndicatorPlacement` in the `MessageListConfig`. With the floating overlay option (`.overlay`), the date indicator is shown for a short time whenever a new message appears. On the other hand, if you want to always show the date between messages, similarly to Apple Messages and WhatsApp, you should use the `.messageList` option. You can turn off both options by using the `.none` option. Here's an example of how to set up the `messageList` option:
7071

7172
```swift
7273
let utils = Utils(messageListConfig: MessageListConfig(dateIndicatorPlacement: .messageList))
7374
let streamChat = StreamChat(chatClient: chatClient, utils: utils)
7475
```
7576

76-
If you want to replace the separating date indicator view, you need to implement the `makeMessageListDateIndicator` method. You can control the size of this view view with the `overlayDateLabelSize` in the `MessageDisplayOptions`.
77+
If you want to replace the separating date indicator view, you need to implement the `makeMessageListDateIndicator` method. You can control the size of this view with the `overlayDateLabelSize` in the `MessageDisplayOptions`.
7778

7879
```swift
7980
public func makeMessageListDateIndicator(date: Date) -> some View {

0 commit comments

Comments
 (0)