Skip to content

Commit 87aeadb

Browse files
Updated the docs
1 parent 504bf45 commit 87aeadb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@ You can completely swap the leading composer view with your own implementation.
1717

1818
In order to do this, you need to implement the `makeLeadingComposerView`, which receives a binding of the `PickerTypeState`. Having the `PickerTypeState` as a parameter allows you to control the visibility of the attachment picker view. The `PickerTypeState` has two states - expanded and collapsed. If the state is collapsed, the composer is in the minimal mode (only the text input and leading and trailing areas are shown). If the enum state is expanded, it has associated value with it, which is of type `AttachmentPickerType`. This defines the type of picker which is currently displayed in the attachment picker view. The possible states are `none` (nothing is selected), `media` (media picker is selected), `giphy` (giphy commands picker is shown) and custom (for your own custom pickers).
1919

20+
Apart from the `PickerTypeState`, you also receive the `ChannelConfig` as a parameter. This config allows you to control the display of some elements from the channel response from the backend, such as enabling / disabling of the attachments, max message length, typing indicators, etc.
21+
2022
Here's an example on how to provide a view for the leading composer view:
2123

2224
```swift
2325
public func makeLeadingComposerView(
24-
state: Binding<PickerTypeState>
26+
state: Binding<PickerTypeState>,
27+
channelConfig: ChannelConfig?
2528
) -> some View {
26-
AttachmentPickerTypeView(pickerTypeState: state)
29+
AttachmentPickerTypeView(
30+
pickerTypeState: state,
31+
channelConfig: channelConfig
32+
)
2733
}
2834
```
2935

0 commit comments

Comments
 (0)