Chat UIKit iOS v3
Chat UIKit iOS
Chat UIKit
iOS
Version 3

UIKit for iOS allows you to create customizable views and execute essential chat functions such as list channels, create channels, and chat in channels. Key functions are available through view controller. Each function corresponds to a single view controller that creates the UI views. As shown in the table below, a key function is composed of four main elements: view controller, view model, module, and component. Each view controller has a view model and a module, which is composed of several components, also referred to as module components.

List of views

Copy link
Key functionViewControllerViewModelModuleComponent

List channels

SBUGroupChannelListViewController

SBUGroupChannelListViewModel

SBUGroupChannelListModule

Header, List

Chat in a group channel

SBUGroupChannelViewController

SBUGroupChannelViewModel

SBUGroupChannelModule

Header, List, Input

Chat in an open channel

SBUOpenChannelViewController

SBUOpenChannelViewModel

SBUOpenChannelModule

Header, List, Input, Media

Create a group channel

SBUCreateChannelViewController

SBUCreateChannelViewModel

SBUCreateChannelModule

Header, List

Invite users

SBUInviteUserViewController

SBUInviteUserViewModel

SBUInviteUserModule

Header, List

Register members as operators

SBURegisterOperatorViewController

SBURegisterOperatorViewModel

SBURegisterOperatorModule

Header, List

Register participants as operators

SBURegisterOperatorViewController

SBURegisterOperatorViewModel

SBURegisterOperatorModule

Header, List

List users in a group channel

SBUUserListViewController

SBUUserListViewModel

SBUUserListModule

Header, List

List users in an open channel

SBUUserListViewController

SBUUserListViewModel

SBUUserListModule

Header, List

Configure group channel settings

SBUGroupChannelSettingsViewController

SBUGroupChannelSettingsViewModel

SBUGroupChannelSettingsModule

Header, List

Configure open channel settings

SBUOpenChannelSettingsViewController

SBUOpenChannelSettingsViewModel

SBUOpenChannelSettingsModule

Header, List

Moderate group channels and members

SBUModerationsViewController

SBUModerationsViewModel

SBUModerationsModule

Header, List

Moderate open channels and participants

SBUModerationsViewController

SBUModerationsViewModel

SBUModerationsModule

Header, List

Search messages

SBUMessageSearchViewController

SBUMessageSearchViewModel

SBUMessageSearchModule

Header, List

Reply to messages

SBUMessageThreadViewController

SBUMessageThreadViewModel

SBUMessageThreadModule

Header, List, Input


Architecture

Copy link

For each key function, a view controller exists. It's composed of module and view model, which are both needed to build a view and gather data from the Chat SDK. The following diagram explains the basic architecture of UIKit for iOS.

ViewController

Copy link

Every key function in Sendbird UIKit is available through a view controller. You can call the methods of a module and its components in the view controller to allow users to interact with the UI of the view. When events occur in the module component, the view controller is notified through a delegate. The view controller can also send data needed to update the view to the module component through a data source.

Module

Copy link

In every key function, a module exists and there are multiple components configured within the module. The view controller can use any of these components along with data from a view model to create a functional view.

Module component

Copy link

A component, also referred to as module component, is the part of view controller that builds a view. It's written as a {MODULE_TYPE}.{COMPONENT_TYPE} property in the code as every component belongs to a module. The component uses the configure method to set up a view when the loadView() method of the view controller is called.

Component delegate

Copy link

The view controller can receive events that occur in a module component through a delegate.

Component DataSource

Copy link

A data source is used to access objects, such as data needed to update the view or implement the module component, from a view controller.

ViewModel

Copy link

The view model processes and requests data directly from Sendbird Chat SDK. It processes the data it gathers from Chat SDK so it can be used appropriately in UIKit. While view models and modules don't communicate with each other, the view controller acts as the intermediary. Through the view controller, they can call each other's functions and exchange data. Like module component, the view model also has a delegate that sends events to the view controller.