Skip to content

Commit a1c0b4b

Browse files
Updated the docs
1 parent f3e6aec commit a1c0b4b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@ 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+
## No Messages View
175+
176+
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.
177+
178+
Here's an example usage:
179+
180+
```swift
181+
public func makeEmptyMessagesView(
182+
for channel: ChatChannel,
183+
colors: ColorPalette
184+
) -> some View {
185+
Color(colors.background)
186+
.frame(maxWidth: .infinity, maxHeight: .infinity)
187+
}
188+
```
189+
174190
Finally, don't forget to inject your custom factory to our view hierarchy.
175191

176192
```swift

0 commit comments

Comments
 (0)