Skip to main content
A New Chat screen lets the user start a one-to-one chat or open a group without an existing conversation. You build it from CometChatUsers and CometChatGroups, opened from a button on the conversations list.

Overview

  1. A compose button on the conversations list opens the New Chat screen.
  2. A segmented control switches between Users and Groups; both lists search and page.
  3. Picking a user opens a one-to-one chat. Picking a public group you have not joined joins it first, then opens it.

Prerequisites

Components

Integration Steps

1. Add the entry point to the conversations list

ChatsView.swift

2. Build the New Chat screen

Put the two lists behind Users / Groups segments, laid out like the conversations and users lists:
  • The navigation bar keeps the title and the search field. Each list puts its search in the bar it is shown in.
  • The segments are the search field’s scope bar, under the field in the same navigation bar, not a view of your own above or over the list. The bar’s glass and its soft scroll edge are theirs too: the rows scroll under the title, the field and the segments, and fade as they go.
  • No background of your own. The list is the screen’s content and runs under the bar.
The bar is the system’s, so it follows the system: Liquid Glass on iOS 26, and the flat bar on earlier versions and under Reduce Transparency.
cometChatSearchScopes(_:selection:) gives the shown list’s search field its scope buttons and tells you which one is selected. Apply it to whichever list is shown, so the bar keeps the segments across the switch.
NewChatView.swift

3. Handle the selection and open the chat

Open the same chat screen your conversations list opens, with the User or the Group:
MessageView is the chat screen from Conversation List + Message View, which hosts the header and the composer over the list.

Implementation Flow

  1. The compose button presents the New Chat screen.
  2. The user switches between Users and Groups, searching either.
  3. A tap closes the screen and hands you the pick.
  4. You open the chat with that user or group.

Customization Options

  • Filter who is listed — usersRequestBuilder: / set(userRequestBuilder:) and groupsRequestBuilder: / set(groupsRequestBuilder:), for example only friends or only joined groups.
  • Rows and states — both lists take view slots and state views; see Users and Groups.

Edge Cases

Feature Matrix

Next Steps

Users

The users list in full

Groups

The groups list in full

Group Chat

Create, join and manage groups

All Guides

Browse the other guides