Header Component#

The headerComponent includes a default title as Contacts, 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

List Component#

The listComponent shows a list of all contacts after the contacts being synced. The following table shows the parameters of the configure method of the listComponent.

Parameter nameType

View Model#

The MFUICreateChatViewController class uses a view model that is a type of the MFUICreateChatViewModel class. The view model is created in the initializer of the view controller through the createViewModel(contacts: type:) method. When the view model object is created, it retrieves contacts list data from Chat SDK to the view controller and updates the view through the createChatViewModel(_:didChangeUsers:needsToReload:) event.

The following table shows the parameters list of the createViewModel method

Parameter nameType
typeChatCreationType = .newSinglehChat

Used the following function to get the Users list from the SDK who are all using the same license key.

ContactManager.shared.getUsersList(pageNo, pageSize, search){ isSuccess,flyError,flyData in
if isSuccess{
var data = flyData
if let profileArray = data.getData() as? [ProfileDetails]{}
let totalPages = data["totalPages"] as? Int
let totalUsers = data["totalRecords"] as? Int
} else {
//print error
pageNointPage number of user list default value 1
pageSizeintNumber of users per page default value 50
searchStringtext characters for which search has to happen default value empty
CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler

Pagination and Search#

Contacts can be searched using search option.

Pagination is implemnted to fetch the user from API