Chat UIKit SwiftUI v3
Chat UIKit SwiftUI
Chat UIKit
SwiftUI
Version 3

Moderate group channels and members

Copy link

You can moderate group channels and members in UIKit through the GroupModerationsView struct. This structure is used to display a moderation view for operators, muted members, and banned users, and the option to freeze the channel.

Note: By default, the moderation menu in GroupChannelSettingsView is accessible for operators only.


Initialize

Copy link

You can start building a moderation view by initializing the GroupModerationsView structure.

import SwiftUI
import SendbirdSwiftUI

struct ContentView: View {
    @ObservedObject var provider: GroupModerationsViewProvider

    var body: some View {
        GroupModerationsView(provider: provider)
    }
}

Init parameters

Copy link
ParameterTypeRequired

provider

GroupModerationsViewProvider

o

View Proivder init parameters

Copy link
ParameterTypeRequired

channelURL

String

o


Customization

Copy link

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

Copy link

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

Copy link
ParameterTypeView builders

headerItem

GroupModerationsType.HeaderItem

leftView
rightView
titleView

The following code demonstrates how to replace the view items using headerItem. All other {Component}Items 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 the headerItem, the customizations of the coverImage or titleLabel in the lower view items will not be applied.

var body: some View {
    GroupChannelView(
        provider: provider,
        headerItem: {
            .init()
            .leftView { viewConfig in
                Text("Left")
            }
            .rightView { viewConfig in
                Text("Right")
            }
        }
    )
}

Full customization

Copy link

At this moment, this screen does not support entire customization.

DestinationViewBuilder

Copy link

At this moment, this screen does not support DestinationViewBuilder.