SingleChat/ Group Chat

Header Component#

The headerComponent includes a chat title (UserName from the RecentChat), a back button that takes the user to the previous view. Each property corresponds to the elements in the navigation bar of the view controller.

The following table shows the parameters of the configure method of the headerComponent.

Parameter nameType
delegateMFUIChatViewParentModuleHeaderDelegate
themeMFChatTheme

List Component#

The listComponent shows a list of all messages in the chat. The following table shows the parameters of the configure method of the listComponent.

Parameter nameType
delegateMFUIChatViewParentModuleListDelegate
dataSourceMFUIChatViewParentModuleListDataSource
themeMFChatTheme

Input Component#

The inputComponent shows the input field of a chat where users can type and send their messages. The following table shows the parameters of the configure method of the inputComponent.

Parameter nameType
delegateMFUIChatViewParentModuleInputDelegate
dataSourceMFUIChatViewParentModuleInputDataSource
themeMFChatTheme

View Model#

The MFUIChatViewParentController class uses a view model that is a type of the MFUIChatViewModel class. The view model is created in the initializer of the view controller through the createViewModel(chat:startingPoint:showIndicator:) method. When the view model object is created, it retrieves message list data from Chat SDK to the view controller and updates the view through the baseChatViewModel(_:didChangeMessageList:needsToReload:initialLoad) event.

The following table shows the parameters list of the createViewModel method

Parameter nameType
chatRecentChat
startingPointInt64
showIndicatorBool