SingleChat/ Group Chat
#
Header ComponentThe 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 name | Type |
---|---|
delegate | MFUIChatViewParentModuleHeaderDelegate |
theme | MFChatTheme |
#
List ComponentThe listComponent shows a list of all messages in the chat. The following table shows the parameters of the configure method of the listComponent.
Parameter name | Type |
---|---|
delegate | MFUIChatViewParentModuleListDelegate |
dataSource | MFUIChatViewParentModuleListDataSource |
theme | MFChatTheme |
#
Input ComponentThe 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 name | Type |
---|---|
delegate | MFUIChatViewParentModuleInputDelegate |
dataSource | MFUIChatViewParentModuleInputDataSource |
theme | MFChatTheme |
#
View ModelThe 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 name | Type |
---|---|
chat | RecentChat |
startingPoint | Int64 |
showIndicator | Bool |