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

Register participants as operators

Copy link

In Sendbird Chat SwiftUI, you can register a participant as an operator using the OpenChannelRegisterOperatorView. The view displays a list of participants in an open channel and appoint a participant to be the operator.


Initialize

Copy link

You can start building a register as operator view using the OpenChannelRegisterOperatorView. Use the init(channelURL:users:) initializer to create the instance and display the view as shown below.

import SwiftUI
import SendbirdUI

struct ContentView {
    var body: some View {
         OpenChannelRegisterOperatorView(
            channelURL: {CHANNEL_URL},
            users: [{PARTICIPANT}]
        )
    }
}

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

() -> OpenChannelRegisterOperatorType.HeaderItem

leftView
rightView
titleView
- coverImage
- titleLabel
- typingStatusView

listItem

() -> OpenChannelRegisterOperatorType.ListItem

rowView
senderProfileImage
userMessageView
fileMessageView
multipleFilesMessageView
adminMessageView
typingIndicatorView
newMessageInfoView
scrollBottomView
channelStateBanner

inputItem

() -> OpenChannelRegisterOperatorType.InputItem

leftView
- addButton
rightView
- sendButton
- voiceButton

Full customization

Copy link

At this moment, 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.