Configure open channel settings
In Sendbird Chat SwiftUI, you can configure channel settings in open channels through the OpenChannelSettingsView
. In the open channel settings view, participants can change the channel name and cover image, see the participant list, and delete the channel. For channel operators, they can also view the moderation menu.
Initialize
You can start building a open channel settings view through the OpenChannelSettingsView
class. Use the init(channelURL:)
initializer to create the instance and display the view as shown below.
Init parameters
Parameter | Type | Required |
---|---|---|
channelURL | String | o |
Customization
Sendbird Chat SwiftUI provides a View customization
and DestinationViewBuilder
.
- View customization: Our SwiftUI SDK allows you to selectively customize view elements. To learn more about the customization and our SwiftUI is designed, see the customization guide.
- DestinationViewBuilder: Use DestinationViewBuilder to customize the destination views that are navigatable from the group channel view.
Note : Visit our Github Sample to see the custom sample implementation for each item.
Partial customization
You can easily customize a specific part of a View
, which particularly comes in handy when changing only a certain area in the View
.
To do so, use the View Builders that Sendbird has predefined and its a ViewConfig
. The ViewConfig
contains the data needed to render the view and its parameters can be found in the table below.
Parameter
Parameter | Type | View items |
---|---|---|
headerItem | OpenChannelSettingsType.HeaderItem | leftView |
The following code demonstrates how to replace the view items using headerItem
. All other {Component}Item
s can be used in the same way.
Note : When you customize a parent view, customizations in the child views will not be applied. For example, if you customize the
titleView
in theheaderItem
, the customizations of thecoverImage
ortitleLabel
in the lower view items will not be applied.
Full customization
At this moment, this screen does not support entire customization.
DestinationViewBuilder
Sendbird Chat SwiftUI is designed to internally navigate from each view to its connected view. However, if you need to customize the destination view, you can do so by using the interface provided by the DestinationViewBuilder
.
DestinationViewBuilder method
Method | ViewBuilder type |
---|---|
participantListView | OpenParticipantListViewBuilder |
moderationsView | OpenModerationsViewBuilder |
The following code demonstrates how to replace the channel settings view connected from the channel view.
Note : If you've customized a child view of another view, you need to set the destination view for all the views from the top to the destination view.