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

Register members as operators

Copy link

In Sendbird Chat SwiftUI, you can register a member as an operator using the GroupChannelRegisterOperatorView struct.


Initialize

Copy link

You can start building a register as operator view by initializing the GroupChannelRegisterOperatorView struct. The view displays a list of users to select channel members from. Once the members have been chosen, a new group channel will be created.

import SwiftUI
import SendbirdSwiftUI

struct ContentView: View {
    @ObservedObject var provider: GroupChannelRegisterOperatorViewProvider 

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

Init parameters

Copy link
ParameterTypeRequired

provider

GroupChannelRegisterOperatorViewProvider

o

View Proivder init parameters

Copy link
ParameterTypeRequired

channelURL

String

o

users

[SBUUser]

x


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

GroupChannelRegisterOperatorType.HeaderItem

leftView
titleView
headerView

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.

GroupChannelRegisterOperatorView(
    provider: provider,
    headerItem: {
        .init()
        .rightView { config in
            Text("Right")
                .foregroundStyle(.blue)
        }
    }
)

Full customization

Copy link

Please note that this screen does not support entire customization.

DestinationViewBuilder

Copy link

This screen has no DestinationViewBuilder because there's no navigational elements, such as buttons or links to other screens.